On 30 May, 09:43, Javier <jjeron...@gmail.comwrote:
Hi,
I have just read that struct's in C++ can have public and private
members, so I have one question:
Which are the differences between classes and structs
Almost nothing.
(besides constructors and destructors?).
That's not a difference. structs have constructors and destructors,
either compiler generated or written by you, in exactly the way
classes do.
Your answer is in the FAQ.
http://www.parashift.com/c++-faq-lit...s.html#faq-7.8
The differences described in the first sentence of that FAQ are the
*only* technical differences between a struct and a class. But do note
the rest of the FAQ that describes the different ways the two are
generally used.
Gavin Deane