JK> Which are the diffs of struct and class in C++... I know the
JK> public/private defaults...
Then you know it all!! A struct is a class where members default to
public. There's no other semantic/syntactic difference between a struct
and a class.
That said, many/most C++ programmers use structs and classes for
different things. A class is used to instantiate an object that
does something. If the class is a collection of data, then you
would tpically have support functions to add data, organize data,
display data read/write data etc.
A struct is usually used just to organize related data.
---
þ Blue Wave/QWK v2.12 þ
---------------
* Origin: St. Louis Users Group (1:100/4)
|