1. A heavy pointer
1.1 For function parameters
Can be passed in or out
1.2 For function return values
2. Double pointer
2.1 for Two-Dimensional Data Use
For example, save an articleArticle(How many rows and columns)
Mainly stores two levels of data
2.2 Create Function Parameters
It can be used to allocate memory and then record it at the position pointed to by the parameter.
# Include <stdio. h> # include <string. h> // used as a record pointer change, for example, allocating memory int ialloc (char ** P, int size) {* P = (char *) malloc (size ); if (* P = NULL) return 0; return 1;} int main () {char * CP; char * STR = "Taoist is a great person"; int Len; if (ialloc (char **) & CP, 22) {memcpy (CP, STR, Len = strlen (STR); CP [Len] = 0; printf (CP );}}
2.3 function return value
3. Triple pointer
4. function pointer
Used for the state machine