The result of the expression operation is a constant value (not writable), the constant is no memory space compiled when the constant will be placed in the constant area, after the string is not modified string constants, characters are character constants (modified), see can be modified from the constant area has been placed into the register, MOV into the variable so it can be modified char* str= "HelloWorld"; char s1[]= "BBO" the difference between int main (int argc, char* argv[]) {int a=1; char* str= "Bbo"; *str= ' m ';
///;c005 The reason is that the constant area of things can not be modified (can only read), and you modified so that will be reported access error //char s1[]= "Bbo"; *s1= ' P '; This
can be modified because the string is a variable in the stack (the string constant is copied inside the stack space), S1 stores the address of the first character (so can modify OK) printf ("Hello world!\n"); return 0;}
char* str= "Bbo"; char s1[]= "BBO" difference