It's not a problem to allocate 2D array or what else in C++. The problem is: how do you want access the allocated storage. You know that it's impossible to declare 2D array variable with run-time defined extents in C and C++.
The most straightforward approach in C style but with templates (w/o argument check):
template <typename T>
T** new2D(size_t m, size_t n)
T** pp = new T*[m];
T* p = new T[m*n];
for (size_t i = 0; i < m; ++i, p += n)
pp[i] = p;
double** pa2d = new2D<double>(m,n);
// to deallocate:
More elaborated approaches: define your own class encapsulated all mechanics described above, use vector<vector< >> or valarray<valarray< >> templates. Search this forum: it was a very popular theme 1 or 2 month ago.
Search inet: there are lots of Matrix classes which implements 2D dynamic arrays logics.