two dimension string array print error

My issue with my code is that i am getting back the locations instead of the actual values for the array at that position.

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
26
#include <iostream>
#include <iomanip>
#include <string>


using namespace std;
int main()
{
    string event[3][6]= {
		{"one", "two", "three","four", "five", "five"},
		{"one", "two", "three","four", "five", "five"},
		{"one", "two", "three","four", "five", "five"}
	                };
					  
	for(int time = 0; time < 3; time++)
	{
		for(int statment = 0; statment < 6; statment++)
		{
			cout << event[time,statment] << endl << endl;	
			statment++;
		}
		time++;
	}
					  
return 0;
}
This is the way.
cout << event[time][statment] << endl << endl;

Didn't your compiler show any warnings ?
thank you, and no it didn't give me a compile error only a logic error of showing locations.
Topic archived. No new replies allowed.