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
At the very least, you will need a type-cast. Are you assuming that your struct is a single byte? Have you checked this: http://www.keil.com/support/docs/928.htm
"At the very least, you will need a type-cast." Or, is a union what you really want?