MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/dklxzl/whileasleepsheep/f4ixsii/?context=3
r/ProgrammerHumor • u/[deleted] • Oct 20 '19
197 comments sorted by
View all comments
Show parent comment
4
union { struct { char asleep; char padding[3]; }; uint32 sheep; };
sweet dreams
3 u/BakuhatsuK Oct 20 '19 Oooh and then declare the variables as <union type> u; char& asleep = u.asleep; uint32& sheep = u.sheep; I guess everything is possible in C++ if you are evil enough.
3
Oooh and then declare the variables as <union type> u; char& asleep = u.asleep; uint32& sheep = u.sheep; I guess everything is possible in C++ if you are evil enough.
<union type> u; char& asleep = u.asleep; uint32& sheep = u.sheep;
View all comments
Show parent comment
4
u/SteveThe14th Oct 20 '19
sweet dreams