### creating a int 2-d array that holds characters

How would i create a 2d int array that hold these char symbols?

a 2D int [ROWS][COLS] array that would hold char symbols:
'.' for clear water
'S' for submarines (in DE_BUG mode)
'#' for sunk submarines
'n' where n is an integer representing the distance between a depth charge location to
the nearest live submarine.
Hello cash,

 a 2D int [ROWS][COLS] array that would hold char symbols:
Yeah, how would I do this?
@cash

The only way I can think of, is fill the array with the values of the characters, as in..
 ``123456789101112131415161718192021222324`` ``````#include using namespace std; int main() { int grid[3][3]={{46,83,35}, {50,46,46}, {46,46,49}}; // 46 = . // 49 to 57 = 1 thru 9 // 35 = # // 83 = S for(int x=0;x<3;x++) { for(int y=0;y<3;y++) { cout << char(grid[x][y]) << " "; } cout << endl; } cout << endl; return 0; }``````
Thanks this works, but how do you know which number correlates with which symbol.
I looked them up in an ASCII table. I wrote the values in the program for you, as well, lines 10 thru 13. In your program, you just check the value at the array location, and print accordingly.

 ``123`` ``````if(grid[row][column] == 35) cout << "There is a sunk sub here." << endl; // etc. ``````