If I define a struct as such:
Is it guarenteed to be sequential in memory such that I can do an assignment like this:Code:struct mystruct { char one; char two; char three; char four; };
And I can access and treat the struct as sequential bytes? Will this work, will it always work, and is it even a good idea to do? The reason is for sending large packets of serial data, I would rather format the packet as a struct and then change the struct to an array of bytes to be sent out.Code:mystruct s; char *p = (char *) &s;