I am attempting to manipulate individual characters in a string, in this case change 4th 'a' to a 'b'.
string password = "aaaaa";
printf("password: %s\n",password);
int j = 'b';
password[3] = (char) j;
printf("password: %s\n",password);
this returns:
password: aaaaa
Segmentation fault
One last note: in the first line I declare 'string' like a variable. This contrivance is allowed by the CS50 library - It should work and I have used it in the past.
Thank you in advance.