• Kurse
  • Code Compiler
  • Diskutieren
  • Preise
  • Teams
Menu
+ 1

What is the best use case of union in C?

Although this topic has been fairly discussed here and many other forums, however I couldn't find the best use case of this feature. Yes the difference between struct and union is in their allocation of memory but why should we prefer one over the other?

c
3rd Jun 2019, 2:23 PM
Ali Anwar
Ali Anwar - avatar
1 Antwort
+ 8
https://www.sololearn.com/discuss/1240354/?ref=app https://www.sololearn.com/discuss/107633/?ref=app https://www.sololearn.com/discuss/1698728/?ref=app https://www.sololearn.com/discuss/1118608/?ref=app https://www.sololearn.com/discuss/1572021/?ref=app https://www.sololearn.com/discuss/202070/?ref=app https://www.sololearn.com/discuss/1712720/?ref=app https://www.sololearn.com/discuss/819953/?ref=app
3rd Jun 2019, 3:02 PM
Rstar
Rstar - avatar

Häufig solche Fragen?

Effizienter lernen, kostenlos:

  • Einführung in Python

    7.1M Lernende

  • Einführung in Java

    4.7M Lernende

  • Einführung in C

    1.5M Lernende

  • Einführung in HTML

    7.5M Lernende

Alle Kurse anzeigen
Heute heiß
How can I print a Python set so it looks clean (no {} brackets or quotes)?
2 Votes
Where make_unique is better than unique_ptr(raw pointer)
0 Votes
Can someone help and explain better on slicing
1 Votes
How do I remove duplicates from a list but keep the order?
0 Votes
Will i land a job
1 Votes
Best way to learn a new programming language fast?
1 Votes
How do I print a multiplication table neatly?
0 Votes
SoloLearn courses
2 Votes
Hill Climbing
0 Votes
Course
1 Votes