answersLogoWhite

0

By reference. The name of the string is converted to a pointer (in C/C++) and given to the function as the address of the first element. (In Java, all objects are passed by reference, and there are no pointers.)

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

When a reference variable is passed to any function than whether it pass address or a copy of a variable?

You cannot arbitrarily determine what is passed to a function from outside of the function. If the function expects a reference, then the memory address of the variable will be automatically passed to the function. If the function expects a value, then a copy of the variable's value is automatically passed instead. In other words, it is the function signature that determines what is passed, not how you call the function.


Scanf function in c for strings?

Use '%s', eg: char name[64]; scanf ("%s", name);


What happen when a c program passes an array as a function argument?

When an array name is passed as a function argument, the address of the first element is passed to the function. In a way, this is implicit call by reference. The receiving function can treat that address as a pointer, or as an array name, and it can manipulate the actual calling argument if desired.


Why in java string args is passed in main method?

The String[] args parameter is an array of Strings passed as parameters when you are running your application through command line in the OS. The java -jar command will pass your Strings update and notify to your public static void main() method. To learn more about data science please visit- Learnbay.co


Check wheather the strings are equal?

int string_equal (char *p1,char *p2) { int status = 1; while ((*p1 *p2) && status==1) { if (*p1++ != *p2++) status = 0; } return status; }

Related Questions

When a reference variable is passed to any function than whether it pass address or a copy of a variable?

You cannot arbitrarily determine what is passed to a function from outside of the function. If the function expects a reference, then the memory address of the variable will be automatically passed to the function. If the function expects a value, then a copy of the variable's value is automatically passed instead. In other words, it is the function signature that determines what is passed, not how you call the function.


How can I replace strings in a text using a specific method or function?

To replace strings in a text using a specific method or function, you can use the "replace" function in programming languages like Python or JavaScript. This function allows you to specify the string you want to replace and the new string you want to replace it with.


What is the the function of the heart strings?

to keep the heart open


What is the function chromatids?

Chromatids are the little strings of DNA inthe process called mitoisis


How do you find out the number of arguments passed to a function in PHP?

With a call to the function func_num_args().


When argument are passed by value the function works with the original arguments in the calling program?

When a function is passed by value the calling function makes a copy of the passed argument and works on that copy. And that's the reason that any changes made in the argument value does gets reflected to the caller.


Is it possibly to return an array of strings in a function without using pointers in C plus plus?

No.


Do declarations describe the data that will be used in the function?

Prototype of function describes return value as well as which data can be passed to the function.


'c' code to compare two strings using strcmp function?

char one [] = "A string" ;char two [] = "Different String" ;if (strcmp (one, two) == 0){puts ("The two strings are identical") ;}else{puts ("The two strings are different") ;}


What mean by reference function in c?

Reference function has no meaning. Variables are passed to functions by reference or by value, depending on the function signature.


In visual basics what is information that is being passed to a function?

argument


Scanf function in c for strings?

Use '%s', eg: char name[64]; scanf ("%s", name);