(1) The variables used to store variable addresses in the C language are called variable pointers, or pointers.
(2) address and pointer, variable or program code is stored in bytes in the organization of the memory, generally by the "address" access, internal storage element identification number, room number is the address, to pay attention to distinguish the contents of the memory unit and the address of the memory unit;
(3) In C language, the variables specifically used to store variable addresses are called "pointer variables", referred to as pointers; pointers are variables that store memory addresses, and the value of a pointer variable is the address of another variable, which is called the pointer variable;
(4) The definition of a pointer variable, the general form:
Type name * pointer variable name;
(Pointer declarator * is used when defining pointer variables, indicating that the defined variable is a pointer)
(5) The type of the pointer and the variable it points to must be the same type. Pointers must also be defined in the assignment first.
(6) The pointer function is also one-way pass, the calling function can change the value of the variable that the argument pointer variable points to, and cannot change the value of the variable.
(7) Access to memory both of them are the same, the pointer name is variable, the array name is dead constant. The pointer represents an address that can be changed and the array is not available. Uncle names can be used as pointers, and pointer variables can be converted to array form
2. Problems encountered during the experiment and solutions:
(1) The concept is many, the content also many, has the preliminary understanding to the pointer, but is not very understanding;
(2) reading and asking classmates;
3. Experience of experiment and summary of the study in this chapter:
(1) Experience: The content of this chapter is many, the concept is also many, to spend more time reading, to practice;
(2) Summary: Preliminary understanding of pointers, need more time to learn, need to understand the concept of pointers, meaning;
4. Reflections and Answers to several questions:
(1) Two pointer variables of the same type can add? Why?
Answer: No. Because the added value may exceed, not within this address, is meaningless, and is not allowed.
(2) When using the scanf () function, the input parameter list needs to use the Fetch address operator &, but when the argument is a character array name and is not used, why? What happens if you precede the character array name with the fetch address operator &
A: Because the value of a character array name is a special fixed address and can be considered a constant pointer, you do not need to use the fetch address character to get the address of the array.
If you add the address operator & before the character array name Str, then the address &str can be treated as the address of the first element of the array, since the address of the array address and the first element of the group is the same, so &str means that the address value is equal to the address value represented by Str. For a variable-length argument list of scanf (), the compiler is only responsible for parameter passing, and how to interpret the meaning of several of the following addresses is determined by the string in front. So using scanf ("%s", str) and scanf ("%s", &STR) can be compiled and executed properly.
(3) The C language is not allowed to assign values directly to an array using an assignment expression, why?
A: Because the array name of an array is essentially a pointer constant to the first element of the array, you cannot assign a constant to it, and it is not a scalar.
Basic application of experimental 11--pointers