Jun 5, 2010 #1 N Naumanpak Member level 2 Joined Nov 19, 2009 Messages 51 Helped 2 Reputation 4 Reaction score 2 Trophy points 1,288 Location Pakistan Activity points 1,635 Experts, Its me again.. Using mikroc c compiler and cannot declare structure objects. struct information { int speedlimit; char name[30]; }; struct decoded { float latitude; char latitude_dir; float longitude; char longitude_dir; int speed; float angle; information info; long time; }; get an error on the bold line. Same is the case in main(), I get errors on declaring one. Any suggestions?? thanks.
Experts, Its me again.. Using mikroc c compiler and cannot declare structure objects. struct information { int speedlimit; char name[30]; }; struct decoded { float latitude; char latitude_dir; float longitude; char longitude_dir; int speed; float angle; information info; long time; }; get an error on the bold line. Same is the case in main(), I get errors on declaring one. Any suggestions?? thanks.
Jun 5, 2010 #2 N numa Member level 2 Joined May 26, 2010 Messages 47 Helped 12 Reputation 24 Reaction score 4 Trophy points 1,288 Location NO HIDDEN LINKS Activity points 1,539 Use either typedef or keyword struct as in the following examples. typedef struct information { ......... }; struct decoded { .......... information info; long time; }; OR struct information { ......... }; struct decoded { .......... struct information info; long time; }; Hope this works with MicroC.
Use either typedef or keyword struct as in the following examples. typedef struct information { ......... }; struct decoded { .......... information info; long time; }; OR struct information { ......... }; struct decoded { .......... struct information info; long time; }; Hope this works with MicroC.
Jun 5, 2010 #3 N Naumanpak Member level 2 Joined Nov 19, 2009 Messages 51 Helped 2 Reputation 4 Reaction score 2 Trophy points 1,288 Location Pakistan Activity points 1,635 thanks Numa, I finally got it working! It was the difference of syntax between the two compilers. cheers
thanks Numa, I finally got it working! It was the difference of syntax between the two compilers. cheers
Jun 5, 2010 #4 A amraldo Advanced Member level 4 Joined Aug 29, 2004 Messages 1,183 Helped 145 Reputation 290 Reaction score 37 Trophy points 1,328 Location Egypt Activity points 5,880 Actually, this is standard C A good reference is C Programming by Example. -- Amr