Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Struct packing
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 #include <iostream> #include <Windows.h> struct Before { bool b1; void* p1; void* p2; UINT u1; bool b2; bool b3; bool b4; bool b5; bool b6; }; struct After { void* p1; void* p2; UINT u1; bool b1; bool b2; bool b3; bool b4; bool b5; bool b6; }; int main() { std::cout << "Before: " << sizeof(Before) << " bytes" << std::endl; std::cout << "After: " << sizeof(After) << " bytes" << std::endl; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
C string literal
1337
Arrays
Dices by GOOSE
vector destruction - visual studio
C++ standard library formatted input hexadecimal float without prefix or exponent test case
Permute
additional layer of indirection
Chord Note Finder
sample ptr and obj ex
Please log in to post a comment.