I think what you're looking at is something like:
Code:
#include <stdio.h>
void foo(char *str)
{
*str = 'T'; // change the data pointed to by the pointer
// make it a 'T' -- this change is visible in main
str++; // change the address the pointer points to
// str now points the the second char in buf -- this change will be lost when the function returns
}
int main(void)
{
char buf[] = "this is a test";
printf("buf = %s\n", buf);
foo(buf);
printf("buf = %s\n", buf); // Now, with upper case 'T' at the start, but still the whole string
// if the address pointed to were changed, this would print "his is a test" -- missing the initial 'T'
return 0;
}
What's it's saying is that the address passed in a pointer parameter is "pass by value", i.e. changing what the pointer points to in foo wont change the pointer you passed in (e.g. buf), but you can change the data pointed to by buf.