I am currently reading some C++ source code, and I came across this:
double **out;
// ... lots of code here
// allocate memory for out
out = new double*[num];
Not entirely sure what it does, or what it means. Is it a pointer… to another pointer?
There is also the following:
double ***weight;
// allocate memory for weight
weight = new double**[numl];
I am quite confused :P, any help is appreciated.
new double*[num]is an array of double pointers i.e. each element of the array is adouble*. You can allocate memory for each element usingout[i] = new double;Similarlyweightis an array ofdouble**. You can allocate the memory for each weight element usingnew double*[num](if it is supposed to be an array ofdouble*)