Some question about strings

This is a discussion on Some question about strings within the C Programming forums, part of the General Programming Boards category; I've been given a code:
Code:
char *advance(char *ptr)
{
return ptr++;
}
int main() {
char *ptr="12";
advance(ptr);
ptr=advance(ptr);
...

1) a copy of ptr in main is passed to advance.
2) the value of that pointer is copied to a temporary.
3) the argument ptr of advance is incremented
4) the temporary ( the same value that was passed ) is returned
effectively the call to advance does not change anything in main.
Kurt

Just changing the parameter to a reference wouldn't change anything.
You would also have to change advance to not return the pointer, or remove the assignment in main.
The easiest solution is in my 1st reply.
But why don't you just modify your code and see what happens ?
Kurt