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?
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!