Printing an 4x4 grid and storing it in an array?
Hi guys, I'm new here and I'm fairly new to C.
This maybe simple to most of you guys but I'm extremely frustrated because I don't know what to do with it at all.
The problem is, I want to print out a pattern of this type:
Code:
+---+
| |
| |
+---+
and then storing this in an array so that when a user types in 4,3 it should point to board[4][3]. The grid size is supposed to be 8x8 but in the interest of simplicity, I'm going to start with a 4x4 grid.
The problem is, I don't know how to print out that 4x4 grid with that pattern and I don't know how to store it in the array. Can someone please point me in the right direction?
If you want to see some coding, all I have for now is this:
Code:
#include <stdio.h>
#include <string.h>
char board[4][4];
int main() {
for (int i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
board[i][j] =
}
}
I'm really stuck as to what to input for board[i][j] and I'm unsure if that would even solve that problem...
Thanks in advance!