The program always crashs where the memory is deallocated. Any one could
help me? Thanks!
#include <iostream>
void main()
{
//Allocate
int **a=new int* [4];
for(int i=0;i<10;++i)
a[i]=new int [10];
for(int i=0;i<4;++i)
for(int j=0;j<10;++j)
a[i][j]=100*i+j;
for(int i=0;i<4;++i)
for(int j=0;j<10;++j)
std::cout<<a[i][j]<<std::endl;
//Deallocate
for(int i=0;i<4;++i)
delete [] a[i];
delete [] a; //crash at here!
}