This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Expression must have a constant value

Hi,

 

I would like to define an array as:

 

int N = 100;

double Xn[N];

 

However, an error occurs: expression must have a constant value.

 

 

If I change the expression as follows:

 

double Xn[100].

 

no error occurs.

I don't know the reason.

The upper expression could be compiled in Dev-C++, and is easy to be modified.

 

Thanks.

 

PP