1. Arrays are never pointers
2. When you receive data using the SCANF function, you can replace the address of the variable with a pointer
int A; int *p = &a;scanf ("%d", &a); // available scanf ("%d", p); alternative
3. Receive string with%s
Char str[];scanf ("%s", str);
4. The array name is the address of the first element of the array, pointing to the array with a pointer
Char " FISHC " ; char *p = A;
5. (p+1) refers to the next element of the array, rather than simply adding 1 to the address
printf ("*p =%c,* (p+1) =%c\n", *p,* (p+1)); // Remember to tie the brackets
You can also access the array directly using the
printf ("a =%c,a+1 =%c\n", *a,* (A +1));
6. Character pointer variables
#include <stdio.h>#include<string.h>intMain () {Char*str ="I love fishc.com! "; inti,length; Length=strlen (str); for(i =0; I <length; i++) {printf ("%c", Str[i]); } printf ("\ n"); return 0;}
"Take you to learn C take you to fly"---pointer and array