Sunday, 11 May 2014

How to create a Two Dimensional dynamic array of integers?


int main()
{
int size;

  std::cin >> size;
int **array  = new int *[size];

for(int i= 0; i< size;i++)
{
    array[i] = new int[size];
}
return 0;
}
This will make size*size 2D array.

No comments:

Post a Comment