I don't understand the output of below program.
Expand|Select|Wrap|Line Numbers
- #include<iostream.h>
- void print(char *p)
- {
- p="Pass";
- cout<<"\n value is :"<<p;
- }
- void main()
- {
- clrscr();
- char *q="Best of Luck";
- print(q);
- cout<<"\n New Value is : "<<q;
- }
The value is : Pass
New Value is : Best of Luck
Isn't a string passed by reference? Pls explain the reason for this answer .