Image

Imagemireille719 wrote in Imagecpp S-M-R-T

Quick (and very basic) question re 2-D dynamic arrays.

Okay, so I happened to miss the day we talked about these (I'm in freshman programming) and my book's no help.

I know with a static array, in a function prototype or header, you only include the second size parameter, so that you do things like:

void fillArray(char myArray[][10], int numRows)
{
//this function is going to fill an array that is numRows x 10 in size.
}

But with a dynamically declared array, what do you put in the header in place of the integer/declared integer constant value?

I have a function that has a header something like this:

void fillArray(char myArray[][???], int n)
{
//this is a dynamically-declared array with n rows and n columns.
}

What do I put in instead of the ??? ?

Really, I can't believe I don't know this....