Mar 4, 2015 #1 A AliBahar Member level 2 Joined Feb 4, 2015 Messages 42 Helped 0 Reputation 0 Reaction score 0 Trophy points 6 Activity points 337 Hi friends, I have written the below code which is compiled with codevisionAVR: Code: typedef struct { unsigned char QAddrHi; unsigned char QAddrLo; unsigned char QcountHi; unsigned char QcountLo; unsigned char RByteCount; unsigned int RNum; unsigned char RData[NumDefault]; } IOData; IOData.QAddressHi=*data; data is the name of an array and it's type is unsigned char; but this error appears:illegal symbol.
Hi friends, I have written the below code which is compiled with codevisionAVR: Code: typedef struct { unsigned char QAddrHi; unsigned char QAddrLo; unsigned char QcountHi; unsigned char QcountLo; unsigned char RByteCount; unsigned int RNum; unsigned char RData[NumDefault]; } IOData; IOData.QAddressHi=*data; data is the name of an array and it's type is unsigned char; but this error appears:illegal symbol.
Mar 4, 2015 #2 tilz0R Junior Member level 1 Joined Jul 30, 2012 Messages 19 Helped 4 Reputation 8 Reaction score 4 Trophy points 1,283 Location Crnomelj,Slovenia Activity points 1,371 What about that: Code: typedef struct { unsigned char QAddrHi; unsigned char QAddrLo; unsigned char QcountHi; unsigned char QcountLo; unsigned char RByteCount; unsigned int RNum; unsigned char RData[NumDefault]; } IOData; IOData MyData; int main() { MyData.QAddressHi = *data; } EDIT: Of course it does not work, because QAddressHi does not exists in your structure.
What about that: Code: typedef struct { unsigned char QAddrHi; unsigned char QAddrLo; unsigned char QcountHi; unsigned char QcountLo; unsigned char RByteCount; unsigned int RNum; unsigned char RData[NumDefault]; } IOData; IOData MyData; int main() { MyData.QAddressHi = *data; } EDIT: Of course it does not work, because QAddressHi does not exists in your structure.