Difference 1: Different definitions
1. The string pointer variable itself is a variable used to store the first address of the string. The string itself is stored in a continuous memory space starting with the first address and ends with '\0' as the string.
2. The character array is composed of several array elements and can be used to store the entire string.
Difference 2: Different methods for string pointers
1. char *ps="C Language"; can be written as char *ps;ps="C Language";
2. Array mode char st[]={”C Language”}; cannot be written as char st[20];
St={”C Language”}; can only be used for character arrays Each element is assigned a value one by one. Extended information
Strings are mainly used for programming. See the main text for concept explanations, function explanations, and usage details. Here is an additional point: strings are similar to character arrays in storage, so each of its individual elements is It can be extracted.
For example, s="abcdefghij", then s[1]="b", s[9]="j", and the zero position of the string is its length, such as s[0] =10 (※Ansistring does not have the above function.), which can provide us with a lot of convenience. For example, each digit can be converted into a number and stored in an array during high-precision operations.
The string data type is a data type modeled on the idea of ??a formal string. String is a very important and useful data type that can be implemented in almost all programming languages. They are available as primitive types in some languages ??and as composite types in others.
The syntax of most high-level languages ??allows instances of the string data type to be represented by strings, usually quoted in some way; such metastrings are called "texts" or "string literals".
Baidu Encyclopedia—String