1. If it appears as a string, the compiler will automatically add a 0 to the string as the ending character. If you write "abc" in the Code, the compiler will help you store "abc \ 0 ". 2. Is "abc" a constant? The answer is sometimes, sometimes not. Not a constant: "abc" is not used as the initial value of the character array, for example, char str [] = "abc", because it defines a character array, so it is equivalent to defining some space to store "abc", and because character arrays store characters one by one, therefore, the compiler resolves this statement as char str [3] = {'A', 'B', 'C'}. Based on the above summary 1, so the final result of char str [] = "abc"; is: char str [4] = {'A', 'B', 'C', '\ 0 '}; if char str [] = "abc"; is written in the function, the "abc \ 0" here should be placed on the stack because it is not a constant. Is a constant: When "abc" is assigned to a character pointer variable, such as char * ptr = "abc", because it defines a common pointer, there is no defined space to store "abc", so the compiler has to help us find a place to store "abc". Obviously, taking "abc" as a constant and placing it in the constant area of the program is the most appropriate choice for the compiler. Therefore, although the ptr type is not const char * And ptr [0] = 'X'; can also be compiled, run ptr [0] = 'X '; an exception occurs during running, because this statement attempts to modify things in the constant area of the program. I remember which book once said char * ptr = "abc"; this writing method was originally not allowed in the c ++ standard, but it is too much in c, to be compatible with c, it is not allowed. Although allowed, we recommend that you write const char * ptr = "abc". In this way, if ptr [0] = 'X' is followed, the compiler will not let it compile, this avoids the running exception mentioned above. Expand again. If char * ptr = "abc"; is written in the function body, although "abc \ 0" is put in the constant area, but ptr itself is just a common pointer variable, so ptr is placed on the stack, But it points to something that is placed in the constant zone. 3. the array type is determined by the type of the items stored in the array and the size of the array. For example, char s1 [3] and char s2 [4], s1 is char [3], s2 is char [4], that is, although s1 and s2 are character arrays, however, the two types are different. 4. The String constant type can be understood as the type of the corresponding character constant array. For example, the "abcdef" type can be considered as const char [7]. 5. sizeof is used to calculate the number of bytes of the type. For example, int a; so whether sizeof (int) or sizeof (a) is equal to 4, because sizeof (a) is actually sizeof (type of ). 6. For parameters written as arrays in the function parameter list, the compiler interprets them as common pointer types. For example, for void func (char sa [100], int ia [20], char * p), the sa type is char *, and the ia type is int *, the p type is char * 7. based on the above summary, let's take a look at the actual situation. For char str [] = "abcdef"; there is sizeof (str) = 7, because the str type is char [7], there is also sizeof ("abcdef ") = 7, because the "abcdef" type is const char [7]. For char * ptr = "abcdef"; there is sizeof (ptr) = 4, because the ptr type is char *. For char str2 [10] = "abcdef"; there is sizeof (str2) = 10, because the str2 type is char [10]. For void func (char sa [100], int ia [20], char * p); sizeof (sa) = sizeof (ia) = sizeof (p) = 4, because the sa type is char *, ia type is int *, and p type is char *.