Run-Time Check Failure #2 - Stack around the variable 'board' was corrupted.

Write your question here.
Hello everyone, my code that takes input, puts it in a 2d array then reverses it is crashing. It always gives me the error Run-Time Check Failure #2 - Stack around the variable 'board' was corrupted. for any input.
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
31
32
33
34
35
36
37
38
39
40
41
42
// 2d Array Reverse.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	int board[3][4];
	int row;
	int col;
	cout<< "Enter your First Row First Number"<<endl;
	cin>> board[0][1];
	cout<< "Enter your First Row Second Number"<<endl;
	cin>> board[0][2];
	cout<< "Enter your First Row Third Number"<<endl;
	cin>> board[0][3];
	cout<< "Enter your First Row Fourth Number"<<endl;
	cin>> board[0][4];
	cout<< "Enter your Second Row First Number"<<endl;
	cin>> board[1][1];
	cout<< "Enter your Second Row Second Number"<<endl;
	cin>> board[1][2];
 	cout<< "Enter your Second Row Third Number"<<endl;
	cin>> board[1][3];
	cout<< "Enter your Second Row Fourth Number"<<endl;
	cin>> board[1][4];
	cout<< "Enter your Third Row First Number"<<endl;
	cin>> board[2][1];
	cout<< "Enter your Third Row Second Number"<<endl;
	cin>> board[2][2];
	cout<< "Enter your Third Row Third Number"<<endl;
	cin>> board[2][3];
	cout<< "Enter your Third Row Fourth Number"<<endl;
	cin>> board[2][4];
	cout<< board;

	return 0;
}

Line 20, 28,36: board[x][4] is not valid. You've declared the the board as 3x4. Your second subscript can only be 0-3.
Dumb mistake. Thanks!
Topic archived. No new replies allowed.