char array help

It wont display the char amy, i dont want to do cout statements each time.

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>
#include <windows.h>

using namespace std;
		

char amy[25][25] = {"######################",
		    "#                    #",
		    "#    AMY'S GARDEN    #",
		    "#      EMPORIUM      #",
		    "#                    #",
	            "# SUNTAN, IOWA 12345 #",
		    "#                    #",
		    "######################" };


int main ()
{
	cout << amy;
	  
	

	return 0;
}
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
#include <string>

using namespace std;


string amy[] = {"######################",
                "#                    #",
                "#    AMY'S GARDEN    #",
                "#      EMPORIUM      #",
                "#                    #",
                "# SUNTAN, IOWA 12345 #",
                "#                    #",
                "######################" };

int main ()
{
int length=sizeof(amy)/sizeof(amy[0]);
for(int i=0;i<length;i++)
	cout << amy[i]<<endl;



	return 0;
}
Last edited on
Topic archived. No new replies allowed.