illegal constant expression
Code:
My code is as follows:
---------------------------------------------------------------------------
main.c
---------------------------------------------------------------------------
long VALUE_IP_1,VALUE_IP_2,VALUE_IP_3,VALUE_IP_4; //global variables
void main()
{
VALUE_IP_1 = (*(unsigned long *)0x44020000);
VALUE_IP_2 = (*(unsigned long *)(0x44020000+4));
VALUE_IP_3 = (*(unsigned long *)(0x44020000+8));
VALUE_IP_4 = (*(unsigned long *)(0x44020000+12));
}
-----------------------------------------------------
I then created a diferent file b.c
-----------------------------------------------------
extern long VALUE_IP_1,VALUE_IP_2,VALUE_IP_3,VALUE_IP_4;
long var[4] = {VALUE_IP_1,VALUE_IP_2,VALUE_IP_3,VALUE_IP_4};
When I compile the code I get following error.
Error: illegal constant expression
Please help me solve this problem.I am trying to read the value from the memory locations and store those values in array "var" everytime the program starts.
Thanks
nta