annoying C2801: '}' mission..

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

annoying C2801: '}' mission..

Jump to solution
937 Views
simar
Contributor III

I get this error message while my code is totally correct

Here is my code

 

 

union long_to_float {          unsigned long long_val;          float float_val; };union long_to_float simar,simar_read; //unsigned long simar = 234;simar.float_val = 2.34;unsigned char return_val;  unsigned long* read_data;  //unsigned long p; read_data = &simar_read.long_val;  return_val = IEE1_EraseEeprom(IEE1_AREA_START);
Labels (1)
0 Kudos
Reply
1 Solution
530 Views
simar
Contributor III

corrected

 

 

union long_to_float simar,simar_read; //unsigned long simar = 234;unsigned char return_val; unsigned long* read_data;  //unsigned long p;simar.float_val = 2.34; read_data = &simar_read.long_val;

 

 

Actually all variable declarations has to be done before variable initialisation..

 

View solution in original post

0 Kudos
Reply
1 Reply
531 Views
simar
Contributor III

corrected

 

 

union long_to_float simar,simar_read; //unsigned long simar = 234;unsigned char return_val; unsigned long* read_data;  //unsigned long p;simar.float_val = 2.34; read_data = &simar_read.long_val;

 

 

Actually all variable declarations has to be done before variable initialisation..

 

0 Kudos
Reply