Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
c union bytes affected
//gcc 5.4.0 #include <stdio.h> #include <stdint.h> union { uint64_t u64; uint8_t u8; } my_union; int main(void) { my_union.u64 = 0; printf("bits: 0x%08x\n", my_union.u64); my_union.u64 = ~0; printf("bits: 0x%08x\n", my_union.u64); //notice how most significant 7 bytes of union unaffected. my_union.u8 = 0; printf("bits: 0x%08x\n", my_union.u64); return 0; }
run
|
edit
|
history
|
help
1
Please
log in
to post a comment.
Project 3 Part 1 v0.5
función malloc()
Nearly working
141122_PI6
Project 4 v.6
PUNTEROS 1
B_141104_TresPuntosTriangulo
Rightleftjustfy
141124_PI
Code2
Please log in to post a comment.