On Fri, Apr 01, 2011 at 09:35:35PM -0400, Brian wrote:
> How about a union?  I don't know the exact syntax off hand, but I know
> it will do exactly what you are trying.
By the way great idea - it'll simplify code for futher authors.
But union is not needed here - struct is sufficient.

Something like

struct packet {
        u16 addr;
        s16 value;
} __attribute__((packed));

And just assign desired value to packet.value.

                                        Pavel

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to