LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] OT : Differance between a class and a Struct.

[ILUG] OT : Differance between a class and a Struct.

Scott Wunsch ilug at tracking.wunsch.org
Thu Jan 22 20:49:54 GMT 2004


On Thu, 22-Jan-2004 at 09:31:11 -0800, Justin Mason wrote:

> >Not quite - a class can have a private constructor the difference is
> >that in a class, members are private by default; in a struct they
> >are public.
> 
> Can you subclass a struct?  I didn't think so.

Yes.  In C++ (remember, C++, not C) a "struct" is just another word for a
"class".  The only difference is that members of a class declared using the
"struct" keyword are public by default, but if you declare it with the
"class" keyword, they're public.

A struct in C++ is *not* the same thing as a struct in C.  That's the
trick to this trick question.

-- 
Take care,
Scott \\'unsch

... Ground Water?  Do you mean crushed ice?



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell