|
-
Jan 25th, 2002, 01:12 AM
#1
Thread Starter
Addicted Member
Pointers
Another Query.
#include<iostream.h>
void main()
{
void ox(char*);
char* str="Hello";
ox(str);
cout<<str;
}
void ox(char* abc)
{
cout<<abc;
abc="meory";
}
This displays HelloHello...that means it is actually a call by value that happens(the function is working on a duplicate copy of argument)..while I am passing a pointer to the function..and it should be modifying the contents of the original argument passed.why is this so ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|