-
October 15th, 2009, 04:50 PM
#1
Quick True/False Class Question
Hi everyone!
Just looking at a C++ test for revision.
Several statements are provided regarding C++ classes and I am asked which one is true. I've narrowed it down to two answers:
1 - Whether specified or not, all C++ classes implicilty inherit from class object.
2 - A pointer to an object can only be used to access its class's private member functions if the pointer is in a member or friend function
But am unsure which one is correct, my thoughts are:
1 - I've never heard of this but I read that all .net classes inherit from system.object. I think this is only for VC++ though and so not correct.
2 - Sounds correct to me... but am a little unclear with the wording of the question.
Any thoughts anyone?
Thanks!
-
October 15th, 2009, 07:11 PM
#2
Re: Quick True/False Class Question
Originally Posted by MisterEd
1 - I've never heard of this but I read that all .net classes inherit from system.object. I think this is only for VC++ though and so not correct.
There is no ".net" in C++. C++ is a general purpose language who's rules come from the ANSI/ISO specification. There is no such thing as a ".net" C++. C++ is C++.
The .NET architecture has a totally separate language that uses C++ as a base, called "Managed C++" . This is a superset of C++ and other non-C++ language additions. Do not be confused just because Visual C++ has "true" C++ and another language called "Managed C++" available to you. You should be answering the question as it pertains to true blue C++.
To answer your first question: Do you see foo inheriting from any objects?
Regards,
Paul McKenzie
-
October 15th, 2009, 07:19 PM
#3
Re: Quick True/False Class Question
Hi,
Thanks very much for the clarification, I thought it was something specific to .net but was unsure if there was something I was missing.
cheers!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|