There is one where you just write array[rowSize][colSize]. Another where you declare it as an array of pointers to arrays using new. (From How do I declare a 2d array in C++ using new? )
int** ary = new int*[rowCount];
for(int i = 0; i < rowCount; ++i)
ary[i] = new int[colCount];
There should be one using malloc. Are there any more? What are the pros/cons of each of them? How about their speed of execution/processing?
(This is an interview question. So, more than just suggesting the most optimal method, I need to know what each of these methods do)