Suppose you have the following structure:
#include <windows.h> // BOOL is here. #include <stdio.h> typedef struct { BOOL someBool; char someCharArray[100]; int someIntValue; BOOL moreBools, anotherOne, yetAgain; char someOthercharArray[23]; int otherInt; } Test; int main(void) { printf("Structure size: %d, BOOL size: %d.\n", sizeof(Test), sizeof(BOOL)); }
When I compile this piece of code on my computer (32-bit OS), the output is as follows:
Structure size: 148, BOOL size: 4.
I would like to know if these values ββafter compilation may change depending on the machine that runs the program. For example: if I run this program on a 64-bit machine, will the output be the same? Or once it is compiled, will it always be the same?
Thank you, and I'm sorry if the answer to this question is obvious ...
source share