I'd like to save an input to a function and manipulate it across multiple calls. However, if I do the following...
int testFunc(char *toString) {
static char *toChange = toString;
static int counter = 0;
toChange[counter] = 'A';
printf("String is being corrupted... %s\n", toChange);
counter++;
return 0;
}
I get an error saying that the input toChange cannot be set to a non-static variable. I have been trying to figure out how to get around this but I cannot find any answers.