I am new to C++. I have a program:
#include <iostream>
int main()
{
char* str = "Test";
*str = 'S';
}
The question is, why *str = 'S' crashes the program? As far as I know str must be pointing to the first character of the string (well, char array), so in theory I should be able to modify it. Is it because the memory is read-only for defined constant values? I am using gcc 5.3.0.