char *s1((char *)("foo"));  //1
char s2[] = "foo";  //2
char *s3 = (char *) new char[10];  //3
s1[2] = 'a';  //4
*s2 = 'b';  //5
3[s3] = 'c';  //6
    The string by array in 2 is atually local variable stored on the stack in ontrast to 1 stored in .data
2023 Dec 26, 6:37:31 AM
Login in to like
Login in to comment