Please I wrote this on my compiler and got a lot of error messages please explain | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Please I wrote this on my compiler and got a lot of error messages please explain

1. union numericUnion 2. { 3. int intValue; 4. long longValue; 5. double doubleValue; 6. }; 7. numericUnion myUnion; 8. myUnion.intValue = 3; 9. cout << myUnion.intValue << endl; 10. myUnion.doubleValue = 4.5; 11. cout << myUnion.doubleValue << endl; 12. cout << myUnion.intValue; 13. cout << endl;

18th Nov 2016, 10:28 AM
m johnbosco
m johnbosco - avatar
1 Answer
+ 3
Man the whole code is wrong. Where's your main function?
18th Nov 2016, 10:42 AM
Alireza M
Alireza M - avatar