Ok, I have a structure in my C ++ program that looks like this:
struct thestruct
{
unsigned char var1;
unsigned char var2;
unsigned char var3[2];
unsigned char var4;
unsigned char var5[8];
int var6;
unsigned char var7[4];
};
When I use this structure, 3 random bytes are added to "var6", if I delete "var5", it is still before "var6", so I always know this before "var6".
But if I delete "var6", then 3 extra bytes will disappear.
If I use only the construct with int in it, there are no extra bytes.
So there is a conflict between unsigned char and int, how can I fix this?
source
share