How to print X

How can i print X on the grid using an array?

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 <iostream>
using namespace std;
int main()
{
	char seatPlan[10][6];
	char varStore =65;
	char character= 'X';

for(int row=0; row<10; row++)
	{
		varStore=65;
		for(int col=0; col<6; col++)
		{
			seatPlan[row][col] = varStore++;
		}
	}
	for (int row=0; row<10; row++)
	{
		cout<<"\n"<<row+1<<"\t";
		for (int col= 0; col<6; col++)
		{
			cout<<seatPlan[row][col]<<"\t";//prints grid
		}
	}
What's wrong with simply storing an 'X' in the appropriate place in seatPlan?
1
2
 
  seatPlan[r][c] = 'X';

The X that is placed in grid will need to have been in placed in array so that we can attach a name to it. For example if Someone is sitting in D 6 I will create the option to search that seat to find out the name of the person sitting their

Thanks for your help
Topic archived. No new replies allowed.