invalid index value

 

Hi all, I wrote this code but I have "invalid index value" error. 

input int N1 = 3 ; 

double TH[N1] ;

If I write TH[3] the error is fixed.

I don't understand the reason.

Could you help me?

 

Dichiara TH come array dinamico tipo:

input int N1 = 3 ; 

double TH[] ;

In seguito quando vai a lavorare con l'array, puoi usare TH[N1];

 
Grazie