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