Click here to Skip to main content
15,891,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How can Reduce Final Exe of MFc dialog Based application? Pin
Rolf Kristensen2-Mar-10 12:40
Rolf Kristensen2-Mar-10 12:40 
QuestionTrying to learn OpenGL Pin
BobInNJ26-Feb-10 14:00
BobInNJ26-Feb-10 14:00 
AnswerRe: Trying to learn OpenGL Pin
LunaticFringe26-Feb-10 14:50
LunaticFringe26-Feb-10 14:50 
AnswerRe: Trying to learn OpenGL Pin
Saurabh.Garg26-Feb-10 15:35
Saurabh.Garg26-Feb-10 15:35 
AnswerRe: Trying to learn OpenGL Pin
BobInNJ27-Feb-10 4:21
BobInNJ27-Feb-10 4:21 
GeneralRe: Trying to learn OpenGL Pin
LunaticFringe27-Feb-10 7:30
LunaticFringe27-Feb-10 7:30 
GeneralRe: Trying to learn OpenGL Pin
Rozis27-Feb-10 23:32
Rozis27-Feb-10 23:32 
QuestionClasses and Inheritance, question inside. Pin
rbwest8626-Feb-10 11:47
rbwest8626-Feb-10 11:47 
Hello everyone,

Just so its known this question is related to my programming class. Here is the question out of the book:

"Is it reasonable to create a CHawk by deriving from CBird? How about a COstrich? Justify your
answers. Derive an avian hierarchy that can cope with both of these birds."
class CBird
{
protected:
int wingSpan;
int eggSize;
int airSpeed;
int altitude;
public:
virtual void fly() { altitude = 100; }
};



I thought that the class has to be declared first. Like #include CBird.h goes in the include list. If I am wrong, then the question from the book is YES, CHawk and COstrich can be inherited from CBird.

Can anyone provide me with clarification to classes related to OOP?

Thanks in advance.

V/R

Rob
AnswerRe: Classes and Inheritance, question inside. Pin
Saurabh.Garg26-Feb-10 15:38
Saurabh.Garg26-Feb-10 15:38 
GeneralRe: Classes and Inheritance, question inside. Pin
rbwest8626-Feb-10 17:34
rbwest8626-Feb-10 17:34 
GeneralRe: Classes and Inheritance, question inside. Pin
Tim Craig26-Feb-10 18:50
Tim Craig26-Feb-10 18:50 
GeneralRe: Classes and Inheritance, question inside. Pin
Saurabh.Garg26-Feb-10 20:38
Saurabh.Garg26-Feb-10 20:38 
AnswerRe: Classes and Inheritance, question inside. Pin
David Crow27-Feb-10 4:38
David Crow27-Feb-10 4:38 
AnswerRe: Classes and Inheritance, question inside. Pin
Bram van Kampen27-Feb-10 9:34
Bram van Kampen27-Feb-10 9:34 
QuestionC++ How to retrieve IP Address/Default Gateway Pin
gamefreak229126-Feb-10 10:38
gamefreak229126-Feb-10 10:38 
AnswerRe: C++ How to retrieve IP Address/Default Gateway Pin
Nelek26-Feb-10 11:02
protectorNelek26-Feb-10 11:02 
GeneralRe: C++ How to retrieve IP Address/Default Gateway Pin
gamefreak229126-Feb-10 11:18
gamefreak229126-Feb-10 11:18 
AnswerRe: C++ How to retrieve IP Address/Default Gateway Pin
Moak26-Feb-10 23:17
Moak26-Feb-10 23:17 
AnswerRe: C++ How to retrieve IP Address/Default Gateway Pin
David Crow27-Feb-10 4:41
David Crow27-Feb-10 4:41 
QuestionSpecial character as button label Pin
Dave Colter26-Feb-10 7:58
Dave Colter26-Feb-10 7:58 
AnswerRe: Special character as button label Pin
Nemanja Trifunovic26-Feb-10 8:15
Nemanja Trifunovic26-Feb-10 8:15 
GeneralRe: Special character as button label Pin
Dave Colter26-Feb-10 8:26
Dave Colter26-Feb-10 8:26 
AnswerRe: Special character as button label Pin
Avi Berger26-Feb-10 8:49
Avi Berger26-Feb-10 8:49 
QuestionRe: Special character as button label Pin
CPallini26-Feb-10 9:03
mveCPallini26-Feb-10 9:03 
AnswerRe: Special character as button label Pin
Dave Colter26-Feb-10 9:06
Dave Colter26-Feb-10 9:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.