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
10 naturalnumbers
GraphBase
__FUNCTION__ not a preprocessor macro on clang
hw1 Os
test
INHERIT_CTORS default constructor
BinaryGap, C++ - Find longest sequence of zeros in binary representation of an integer.
vector flavors....
HerbSutter-Virtuality
Arduino Bluetooth Periodiek Systeem