In 'C' How much memory will be reserved for this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

In 'C' How much memory will be reserved for this code?

union student { char name[10]; int roll_number; float percentage; }

3rd Feb 2018, 2:33 PM
ImranKhan CD
ImranKhan CD - avatar
1 Answer
+ 8
10 bytes for 10 chars because union reserve memory just for variable with largest size
3rd Feb 2018, 2:46 PM
Vukan
Vukan - avatar