This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

assigning struct to variable

Hi All,,

Whats wrong with following ??

unsigned char myvar;

struct mystruct{
unsigned char aaa:3;
unsigned char bbb:3;
unsigned char ccc:2;
}mystruct = {1,2,3};

myvar = mystruct;

Why is this assignment illegal ?? What is the way around , if any ??

Thankzz && Bye
-Rocknmoon