What is the difference between a struct and a class in C++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the difference between a struct and a class in C++?

I have a good understanding of what the difference is but could someone give a real in depth answer with best use cases for each.

17th Mar 2017, 1:25 AM
Derek Desentz
Derek Desentz - avatar
1 Answer
+ 14
MSDN has the answer for choosing between Classes and Structures. https://msdn.microsoft.com/en-us/library/ms229017.aspx
17th Mar 2017, 5:28 AM
Hatsy Rei
Hatsy Rei - avatar