1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| #include <stdio.h>
int array_1[] = {10, 20, 30, 40, 50}; int array_2[] = {10, 20, 30, 40, 50}; int array_3[] = {10, 20, 30, 40, 50}; int array_4[] = {10, 20, 30, 40, 50}; int array_5[] = {10, 20, 30, 40, 50};
void main() { int *p = NULL; int v = 0;
p = array_1; v = 0; v = ++*p; printf("v = ++*p;\n"); printf("v = %d, array[0] = %d, array[1] = %d, *p = %d\n\n", v, array_1[0], array_1[1], *p);
p = array_2; v = 0; v = *p++; printf("v = *p++;\n"); printf("v = %d, array[0] = %d, array[1] = %d, *p = %d\n\n", v, array_2[0], array_2[1], *p);
p = array_3; v = 0; v = *(p++); printf("v = *(p++);\n"); printf("v = %d, array[0] = %d, array[1] = %d, *p = %d\n\n", v, array_3[0], array_3[1], *p);
p = array_4; v = 0; v = (*p)++; printf("v = (*p)++;\n"); printf("v = %d, array[0] = %d, array[1] = %d, *p = %d\n\n", v, array_4[0], array_4[1], *p);
p = array_5; v = 0; v = *++p; printf("v = *++p;\n"); printf("v = %d, array[0] = %d, array[1] = %d, *p = %d\n\n", v, array_5[0], array_5[1], *p); }
|