I have the following typedef struct
typedef unsigned int NOTE_FREQ;
/*******A_MUSIC_ELEMENT structure****************/
typedef struct {
NOTE_FREQ frequencyValue;
int duration;
} A_MUSIC_ELEMENT;
Now I want to make an array of A_MUSIC_ELEMENT and with specific values.
A_MUSIC_ELEMENT ZTitleScreen[] = {{60, 20},{80, 50}};
and it compiles fine. but to make things more readable I try to set
int BPM1 = 60;
int BPM2 = 80;
int TIME1 = 20;
int TIME2 = 50;
A_MUSIC_ELEMENT ZTitleScreen[] = {{BPM1, TIME1},{BPM2, TIME2}};
and i get an error saying :
constant expression required
i don't know why since it should be the same thing. i am using windows 8, mplab x IDE, hi tech c compiler. any help to demystify this thanks.