answersLogoWhite

0

You can either use references or you can simply return the result by value. Note that in C++, unlike C, references are not the same as pointers. C++ references are aliases, alternate names for existing objects, whereas pointers are just variables that may contain a memory address that can be dereferenced.

User Avatar

Wiki User

11y ago

What else can I help you with?

Related Questions

Write a function to reverse a string and to display it?

Yes.


How to write a function to reverse an array without using square brackets in the function?

void reverse (char* str) { char *left, *right, temp; left = right = str; while (*right) ++right; --right; while (left < right) { temp = *left; *left = *right; *right = temp; ++left; --right; } }


How do you write string in reverse through the HTML tags?

Not possible through html. Use php strrev function. For eg:


How to write a C program to find largest 2 numbers using pointers?

program to find maximum of two numbers using pointers


Write a program to illustrate the usage of pointers with arrarys and functions?

* * * * * * * * * * write the c++ program and show me brifily?


How do you write c program to perform sum of elements of matrix using pointers with functions?

i cant write


Can you write a program without specifying the prototype of any function?

You can write a program without specifying its prototype when the function returns an integer.If the prototype is not mentioned the compiler thinks that the return type of the function used is integer.When making program which return integer you can ignore writing the protoype.


Piglatin string in c without using pointer?

Sure, you can write a function in C to convert a string to Pig Latin without using pointers by passing the string as a parameter and manipulating it directly within the function. You can split the string into words, check if a word starts with a vowel or consonant, and then apply the appropriate transformation following the rules of Pig Latin. Remember to allocate enough memory for the modified string to prevent buffer overflow.


How do you write a program that outputs a given characters in reverse?

write the javascript code to display the reverse no. of given no. (e.g. 247 reverse of 742)


How do you Write a program in 'c' language which accepts int numbers from the users print its reverse number x function which return value?

question clarity


Write a Program to convert decimal number into hexadecimal no without using function and string?

This is not a question.


Can you write a program without using any semicolon inside the main function?

not possible dude