Created
May 31, 2014 17:37
-
-
Save cschladetsch/f519bee28ba94df2064d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstddef> | |
class Foo | |
{ | |
public: | |
bool _bool; | |
int _int; | |
float _float; | |
}; | |
int main(int argc, _TCHAR* argv[]) | |
{ | |
printf("%d\n", sizeof(bool)); | |
printf("%d\n", offsetof(Foo, _bool)); | |
printf("%d\n", offsetof(Foo, _int)); | |
printf("%d\n", offsetof(Foo, _float)); | |
return 0; | |
} | |
// output: | |
1 | |
0 | |
4 | |
8 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment