in c# I can do this:
private double[,] elevations;
How to do the same in c++ without specifying the size or elements of array on this line?
You cannot do that for arrays in C++.
But, if you want dynamic size, go for std::vector.
And from your question, I see that you are interested in a 2D array. Hence, use a nested std::vector, like this:
vector< vector< double > > elevations;
vector<double>s.
std::vector