I'm new a c++, switched from matlab to run simulations faster.
I want to initialize an array and have it padded with zeros.
# include <iostream>
# include <string>
# include <cmath>
using namespace std;
int main()
{
int nSteps = 10000;
int nReal = 10;
double H[nSteps*nReal];
return 0;
}
It produces an error:
expected constant expression
cannot allocate an array of constant size 0
'H' : unknown size
How do you do this simple thing? Is there a library with a command such as in matlab:
zeros(n);