Possible Duplicate:
What are the differences between struct and class in C++
If the only difference between structs and classes is the default access specifier(in C++), then why does C++ also have classes?
First, it's backward compatibility with C.
Second (and more importantly), it helps describe your intent. The standard convention is that PODs should be denoted with struct
and collections of data and behavior should be denoted with class
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With