This is the struct.
//Structure pour communiquer les paramètres de traitement à travers le MMF
struct params_traitement_mmf
{
int brilliance;
double contraste;
char convolution[9];
};
This is my code to display the size of this struct :
char valeur[10];
sprintf(valeur, "%d", sizeof(params_traitement_mmf));
MessageBoxA(NULL, valeur, "rien", MB_OK);
The MessageBox displays 32.
Thank you!
What packing? And compiled for what platform? Alignment requirement differ between x86, AMD64 and IA64. And packing can wreak havoc in a struct size.
Assuming default packing (8) and AMD64 target (or x86, wouldn’t differ) you have 8 bytes for the
brilliance(4 bytes size, 4 bytes wasted), 8 bytes forcontrasteand then 16 bytes for theconvolution(9 bytes size, 7 bytes wasted). Total 32, which seems just about what you get.