So I'm doing a string basics tutorial in standard C.
I have:
char mystring[] = "HAL";
for (int i = 0; i < 3; i++)
mystring[i] += 1;
for (int k = 0; k < 10; k++)
printf("\n %d", mystring[k]);
which outputs:
73
66
77
0
4
0
0
0
0
0
Now mystring[3] = 0 makes sense to me because I read that string literals terminate in a null character so the number of bytes is n+1 chars. I have no idea why mystring[4] = 4 though. I looked 4 up in an ascii table and it says it's "end of transmission". I did a few quick google searches on end of transmission character for C strings and didn't find anything. So would somebody tell me what's going on here please? Is this a standard thing? When exactly can I expect it to happen?