I have a sample C
program I am trying to understand. Below is a function excerpt from the source code:
double** Make2DDoubleArray(int arraySizeX, int arraySizeY)
{
double** theArray;
theArray = (double**) malloc(arraySizeX*sizeof(double*));
int i = 0;
for (i = 0; i < arraySizeX; i++)
theArray[i] = (double*) malloc(arraySizeY*sizeof(double));
return theArray;
}
My question is what is the significance of the **
in the return type. I know that the *
is generally used as a pointer
. I know that it may also be used to dereference
the pointer.
This makes me think that double**
is a double value because it is essentially the dereferencing of a reference. Is my thinking correct? If not, can someone please explain the use of **
in this example?