// allocate
int** matrix = new int*[rowCount];
for(int i = 0; i < rowCount; i++)
matrix[i] = new int[colCount];
// free
for(int i = 0 ; i < rowCount; i++)
delete[] matrix[i]; // delete array within matrix
delete[] matrix; // delete actual matrix