I'm trying to write a functions to modify strings in C. If I have a function like
char *func(char *s){
char *t=s;
s++; //option 1
t++; //option 2
*t='a'; //option 2
return s;
}
If I do something like [option 1]: s++; I believe it will return the pointer to wherever s is now pointing. If I do [option 2]: t++; and *t='a'; then return s, will it return the address for the first spot of s but with modified contents or will it return the address with the original content?