#include <iostream>
int main()
{
int row = 2, col = 2;
int* a = new int[row * col];
int i, j, count = 0;
for (i = 0; i < row; i++)
for (j = 0; j < col; j++)
*(a+ i*col + j) = count++;
for (i = 0; i < row; i++)
for (j = 0; j < col; j++)
printf("%d ", *(a + i*col + j));
delete[ ] a;
return 0;
}
Output :
0 1 2 3