Saturday, May 9, 2009

ALL arrays in C++ are passed as reference???

ALL arrays in C++ are passed as reference??





CAN ANY BODY TELL ME THAT IS IT TRUE??

ALL arrays in C++ are passed as reference???
yes, but you can pass individual elements within the array by value.





example:





char myarray[10] = "hello";


passbyvalue(myarray[0]);


//passes the letter "h" to the function
Reply:Yes. Arrays are always passed by Reference.
Reply:Yes arrays are passed by name

bloom

No comments:

Post a Comment