TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: JAVIER KOHEN
from: CHRIS DOWNS
date: 1997-04-30 16:35:00
subject: Re: Struct vs. class

 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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.