Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
overloadresolution
Mi primer ejemplo con RexTester colgado en My wall
Vector examples....
vector destruction - clang
Test bitfields with unnamed union
Namespace scope qualifier
Example Node Program
Recursive Call Example Sum
for_each_argument
Simple Generic Data Type Example
Please log in to post a comment.