1. String Array. The string pointer can be output directly.
S2 [] = <s2 <* p = <p [] <endl;
2. the pointer Variable p is allocated with four storage units.
Processing strings with pointer variables is more convenient than processing strings with arrays.
The pointer variable is used to store the variable address, which is usually 4 bytes. Therefore, the length of the pointer variable is 4 bytes.
C = (); I = (); l = (); d = (); p = (*); q = (*); View Code
3. When the static keyword defines a static variable, it is equivalent to only executing the first time. The following program result is 6
<Stdlib. h> c = + = (I =; I <=; I ++ = View Code
4. Execute the printf () function from right to left.
* A [] = {, = &, * p, * p ++); View Code
5. How do I design the number of cycles when they are not sure?
For (; * p2 ++ = * p1 ++;); // use a pointer to copy a string
[Example 7.10] use a pointer to copy strings. Output after execution:
S1 = I am a student
S2 = I am a student
<. H> main (* p1 = s1 [], s2 [* p2 = s2; (; * p2 ++ = * p1 ++ ;); cout <s1 <View Code <. h> main (* p1 =; s1 [], s2 [* p2 = s2; I = (; * p1 ++; I ++) cout <I <endl; cout <s1 <View Code
While (* p1! = '\ N '){...}
6. strlen () Evaluate the string length
<. H> * p = a =, a);} View Code
-------------------
To be continued...