array size
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include <stdio.h> int main(void) { int arrayNumber[3][4] = { 0, }; // arrayNumber[vertical][horizon] int column = 0, row = 0; unsigned int horizon = 0, vertical = 0; row = sizeof (arrayNumber[0]) / sizeof (int); // horizon column = sizeof (arrayNumber) / sizeof (arrayNumber[0]); // vertical for (vertical = 0; vertical < column; vertical++) { for (horizon = 0; horizon < row; horizon++) { arrayNumber[vertical][horizon] = 10; printf("%d ", arrayNumber[vertical][horizon]); } printf("\n"); } printf("row : %d\ncolumn : %d\n", row, column); return 0; } | cs |
0 개의 댓글:
댓글 쓰기