Outputting a string image on console

First, can the members tell me if this is how you make a correct initilizatoin of alphabets. I want it in 5 columns(represeing total height) and 2 rows(representing two alphbets(a and b).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 const string letters[5][2]=
{
				
{"   _____   "						
"  /  _  \\  "
" /  /_\\  \\ "
"/    |    \\"
"\\____|__  /"}, 


{"__________ "
"\\______   \\"
 "|    |  _//"
" |    |   \\"
" |______  //"}
         


};


Moreover, I'm struggling to output this on the screen. I just want the "A" to be outputted on the console, however I get a silly output. here is the code im using
1
2
3
4
5
6
int r=0;
	for (int i=0;i<5;i++)
	{		
			cout<<letters[i][r];
	cout<<endl;
}
Last edited on
Well, you can try unrolling the loop, examining its contents to see if it does what you want (which I'm sure you've realized it doesn't). Your loop is equivalent to printing:
cout<<letters[0][0]<<letters[1][0]<<letters[2][0]<<letters[3][0]<<letters[4][0]<<endl;
Can you see why that is? From there, you should be able to think about it and see what you need to change to print what you want.
Topic archived. No new replies allowed.