I'm trying to make a 2D array that looks like:
----
----
----
----
For the life of my I can't figure it, I'm new to C++. Here are my attempts so far:
char board[boardSize][boardSize];
for(int i=0;i<boardSize;i++){
for(int j=0;j<boardSize;j++){
board[i][j]='-';
}
}
for(int i=0;i<boardSize;i++){
for(int j=0;j<boardSize;j++){
cout<<board[i][j];
}
}
This gives:
----------------
Can anyone please direct me in the right direction? Thank you!