Setting up grid for and array & user initialization of array

Trying to get code to look like

Row 1: ^^^
Row 2: ^^^
Row 3: ^^^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const int siz = 3;

for (int t=0; t<siz;t++)
{
    cout << "Row" << t+1 << ":";
    cout << endl;
}

 
  for (int i=0;i<siz;i++)
 {
      for (int k=0;k<siz;k++)
       
       cout << "^";
       cout << endl;

}

Also was wondering if i wanted to separately ask the user to choose a location to add a char who would i do that ?

( im thinking * cin << arry[][]; ? not sure but ask for them separately
array []1
array []2
= array [][]
You don't want the separate loop at line 3. That's going to cause your labels to print separately. You want to print the labels at line 10.

1
2
3
4
5
6
7
8
const int siz = 3;

  for (int i=0;i<siz;i++)
  {  cout << "Row" << t+1 << ":";
     for (int k=0;k<siz;k++)      
       cout << "^";
     cout << endl;
  } 


I don't understand your second question.
Last edited on
So you want the user to pick a row and column to put their own character? I'd probably read in values for user row and user column characters, I don't know that I'd set up an array for just one space in the grid. Then check for that user row and column position within the inner for loop.
I specifically want to as the user for Row Then the Column that they want to to place there character or a certain character. for Example:

^^^
^^^
^^^
choose row:1
Choose column :2

^$^
^^^
^^^
Topic archived. No new replies allowed.