When do I use a union in C or C++, instead of a struct?

Jacob Sorber November 1, 2021
Video Thumbnail
Jacob Sorber Logo

Jacob Sorber

View Channel

About

Welcome to my channel. I post videos that help you learn to program and become a more confident software developer. I cover beginner-to-advanced systems topics ranging from network programming, threads, processes, operating systems, embedded systems and others. I help you get under-the-hood to better understand how computers work and how you can use them to become stronger students and more capable professional developers. About me: I'm a computer scientist, electrical engineer, researcher, and teacher. I specialize in embedded systems, mobile computing, sensor networks, and the Internet of Things. More about me and what I do: https://www.jacobsorber.com https://people.cs.clemson.edu/~jsorber/ http://persist.cs.clemson.edu/ To Support the Channel: + like, subscribe, spread the word + contribute via Patreon --- [https://www.patreon.com/jacobsorber] Source code is also available to Patreon supporters. --- [https://jsorber-youtube-source.herokuapp.com/]

You May Also Like

Coding Essentials You Can't Miss

AI-recommended products based on this video

Loading...
New Slim 65W USB C Laptop Charger for Lenovo ThinkPad Yoga 7i 7 9i 9 2-in-1 Yoga Book 9i Gen 10 ThinkBook 16 15 14 Gen 8/7 13s 13x 14s IdeaPad Slim/Pro 5X 5i 5 3X 3i 3 2-in-1 Type C Power Cord

New Slim 65W USB C Laptop Charger for Lenovo ThinkPad Yoga 7i 7 9i 9 2-in-1 Yoga Book 9i Gen 10 ThinkBook 16 15 14 Gen 8/7 13s 13x 14s IdeaPad Slim/Pro 5X 5i 5 3X 3i 3 2-in-1 Type C Power Cord

(13)
$24.99
FREE delivery Sat, Jun 21 on your first order
Loading...
135W USB C AC Adapter Charger for Lenovo ThinkPad Z16 P16s P15s P14s E16 E15 E14 T16 Yoga/Slim Pro 9 7 6 7i 9i Book 9 ThinkBook 16 14p 14 15 14s IdeaPad Slim/Pro 9 7 5 Legion 9 Laptop ADL135YSDC3A

135W USB C AC Adapter Charger for Lenovo ThinkPad Z16 P16s P15s P14s E16 E15 E14 T16 Yoga/Slim Pro 9 7 6 7i 9i Book 9 ThinkBook 16 14p 14 15 14s IdeaPad Slim/Pro 9 7 5 Legion 9 Laptop ADL135YSDC3A

(1)
$59.99
FREE delivery Sun, Jun 22
Loading...
140W C to Magnetic 3 Charger, Compatible with MacBook Air 13, 15 Inch/Mac Book Pro 14, 16 Inch, M1/M2/M3/M4 from 2021/2022/2023/2024/2025 Models, 6.6FT【Original Quality】

140W C to Magnetic 3 Charger, Compatible with MacBook Air 13, 15 Inch/Mac Book Pro 14, 16 Inch, M1/M2/M3/M4 from 2021/2022/2023/2024/2025 Models, 6.6FT【Original Quality】

(71)
$49.99
PrimeFREE delivery Sat, Jun 14
200+ bought in past month
Loading...
RAOYI 5Pack 64GB USB Flash Drive USB Stick USB 2.0 Memory Stick Slide Retractable Thumb Drive 64G USB Drive USB Key for Data Storage (Black Red Blue Green Purple)

RAOYI 5Pack 64GB USB Flash Drive USB Stick USB 2.0 Memory Stick Slide Retractable Thumb Drive 64G USB Drive USB Key for Data Storage (Black Red Blue Green Purple)

(4,402)
$26.09
Prime
1K+ bought in past month
Loading...
Netac 64GB USB Stick USB 3.0 Flash Drive, Up to 90MB/s, Thumb Drive for Data Storage, Pen Drive with Swivel Design, Memory Stick for External Storage Data/Computer/PC/Laptop/Sound

Netac 64GB USB Stick USB 3.0 Flash Drive, Up to 90MB/s, Thumb Drive for Data Storage, Pen Drive with Swivel Design, Memory Stick for External Storage Data/Computer/PC/Laptop/Sound

(6,566)
$12.73
FREE delivery Sun, Aug 10 on your first order
100+ bought in past month
Loading...
KEXIN 64GB USB Flash Drive 3 Pack - Swivel Thumb Drives with LED Indicator, High-Speed USB 2.0 (Pink/Yellow/Cyan) for Data Storage, Bulk Pen Drives Multi-Color Pack

KEXIN 64GB USB Flash Drive 3 Pack - Swivel Thumb Drives with LED Indicator, High-Speed USB 2.0 (Pink/Yellow/Cyan) for Data Storage, Bulk Pen Drives Multi-Color Pack

(1,558)
$17.75
Prime
100+ bought in past month
Loading...
Flash Drive 16GB 5 Pack USB 2.0 Swivel Thumb Drives Bulk Memory Stick Jump Drive Pendrive Zip Drive for Data Storage,Black/Blue/Orange/Green/Purple (16G, 5Pcs Mixed Color)

Flash Drive 16GB 5 Pack USB 2.0 Swivel Thumb Drives Bulk Memory Stick Jump Drive Pendrive Zip Drive for Data Storage,Black/Blue/Orange/Green/Purple (16G, 5Pcs Mixed Color)

(983)
$18.04
FREE delivery Sun, Aug 10 on your first order
100+ bought in past month
Loading...
The People's Emergency Plan: A Civilian Guide to Structured Emergency Planning
Best Seller

The People's Emergency Plan: A Civilian Guide to Structured Emergency Planning

(5)
$30.52
FREE delivery Tue, Jun 17 on your first order