1-1 ¶
int main() { int number[10] = { 1,3,5,7,9,11,13,15,17,19 }; int i, * p; for (i = 0; i < 10; i++) { printf("%d\n", *(number + i)); } return 0; }
1-2 ¶
int main() { int number[10] = { 1,3,5,7,9,11,13,15,17,19 }; int i, * p; p = number; for (i = 0; i < 10; i++) { printf("%d\n", p[i]); } return 0; }
1-3 ¶
int main() { int number[10] = { 1,3,5,7,9,11,13,15,17,19 }; int i; int *p = &number[0]; for (i = 0; i < 10; i++) { printf("%d\n", *p++); } return 0; }
2-1 ¶
int main() { int number[3][4] = { {1,3,5,7},{9,11,13,15},{17,19,21,23} }; int i, j,*p; for (i = 0; i < 3; i++) { for (j = 0; j < 4; j++) { printf("%d\n", number[i][j]); } } return 0; }