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.
// 2d Array Reverse.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
usingnamespace 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;
}