Variables in array declarations
I'm having a problem with an error on a line where I'm trying to declare an array. Boiled down, my code looks like this:
Code:
typedef struct
{
...
int width, height;
...
} BMP_INFOHEADER;
int main ()
{
BMP_INFOHEADER infohead;
... // infohead gets filled in here
char ascii [infohead.height][infohead.width]; // error!
...
}
The error I get on that line looks is
"illegal constant expression"
I assume it has something to do with the variables in the [][]'s. I thought I had an idea how to fix it, but I was wrong.
What's going on?