问题
yeah so im new to c and i came across an error when dealing with the following code.:
typedef struct{
int head;
int length;
Customer customer[MAX_LENGTH];
} CustomerCi;
and the error that came out was:
"error: variably modified 'customer' at the file scope"
i have no idea how to fix this and any help would be appreciated (keep in mind that im new to this if it seems like a dumb problem).
回答1:
Replace MAX_LENGTH with a literal value:
#define MAX_LENGTH 32
for example.
来源:https://stackoverflow.com/questions/20292639/c-error-variably-modified-at-the-file-scope