2d array issue

Hi I am having this issue

my code is this .

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
27
28
29
30
 #include <iostream>
using namespace std;

int main()
{
int days =0;
int a,b=0;
int test[2][3];
float sum = 0.0;

for(a = 0; a<3; a++)
{
	cout<<"please enter the number for the days of pass "<<days+1<<endl;
	
	for(b=0; b<3 ; b++)
	{
		cin>>test[a][b];
	}
}


for(b=0;b<3;b++)
{
	sum = sum + test[0][b];
}
cout<<"your results is "<<sum<<endl;
	
	
}



it works, but i get an error "stack around the variable test is corrupted" or something to that effect I dont get where my issue is
int test[2][3];
//...
for(a = 0; a<3; a++)
//...
cin>>test[a][b];
thank you, cant beleive I did that I hsould of known better lol it is weird how most of the time its the smallest thing causing an error lol
Topic archived. No new replies allowed.