If I have a list of global variables like this...
int a;
char b;
float c[10];
double d[3];
and I have an identical sequence of variables listed inside a class...
class test_type
{
int a;
char b;
float c[10];
double d[3];
}
is it guaranteed that the arrangement of all the variables in memory are identical. i.e. is 'b' guaranteed to be stored immediately after 'a' in both the globals list and the class list?
EDIT: I ask because I wanted to A) copy the data from one to the other as a "job lot" and B) I wanted to check for any differences between them as a job lot. If the answer to the main question is "no" then does anyone have any suggestions as to how I get round the problem, preferably leaving existing code as unaltered as possible.