I wrote a multiplication table like this:
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
    int table[9][9], i, j;
    for (i = 0; i < 10; ++i){
        for (j = 0; j < 10; ++j)
        {
            table[i][j] = (i + 1) * (j + 1);
            cout << table[i][j] << "\t";
        }
        cout << endl;
    }
    _getch();
    return 0;
}
And when I run it it gives me the right answer but when I press a key it throws this error:
 run time check faliure #2-stack around the variable table was corrupted
But it doesn't throw that error when I change the code to this:
......
int main(){
    **int table[10][10]**, i, j;
    for (i = 0; i < 10; ++i){
......
If they both give the same answer then what's the difference??
 
     
     
     
     
     
     
     
    