Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Copy uint64 data into uint32 with padding
//clang 6.0.0 #include <iostream> struct MyStruct { void* pPtr; struct { uint64_t stride : 32; uint64_t _pad : 32; }; }; struct MyStructFlat { void* pPtr; uint64_t stride; }; int main() { MyStructFlat sf = {nullptr, 64}; MyStruct s; memcpy(&s, &sf, sizeof(s)); std::cout << s.stride << std::endl; }
run
|
edit
|
history
|
help
0
Saam hash example
Magic, why 1 2?
Non type template argument
Делим на Ноль
regex
Namespace scope qualifier
Virtual Function Example
001
Unqualified free functions
New wall