I am trying to take change a single character in the pointer array I have declared, but I get a seg fault every time. This is what I am trying to do:
void manip(char * bits)
{
bits[3] = 'a';
}
int main() {
char * bits;
bits = "testtesttest";
manip(bits);
printf("%s", bits);
return 0;
}
What am I doing wrong?