I'm having this:
char board_game [3][3] = {0}; // The Board Game
And after this I'm doing that:
scanf("%d%d", &row, &col); // Get The Input And Put It In Row And Column
printf("%d",board_game[row][col]);
There is some output that I don't understand and what does that line mean board_game[row][col]
?
| input | output
| row | col |
|______|______|________
| 0 | 0 | 0
|------|------|--------
| 0 | 1 | 0
|------|------|--------
| 0 | 2 | 0
|------|------|--------
| 0 | 3 | 0
|------|------|--------
| 1 | 0 | 0
|------|------|--------
| 1 | 1 | 0
|------|------|--------
| 1 | 2 | 0
|------|------|--------
| 1 | 3 | 0
|------|------|--------
| 2 | 0 | 0
|------|------|--------
| 2 | 1 | 0
|------|------|--------
| 2 | 2 | 0
|------|------|--------
| 2 | 3 | 1 **WHY 1?**
|------|------|--------
| 3 | 0 | 1 **WHY 1?**
|------|------|--------
| 3 | 1 | 0
|------|------|--------
| 3 | 2 | 0
|------|------|--------
| 3 | 3 | 0
|------|------|--------
Can you please explain to me what is going on?