If I create a class called "tree" and inherit from it to classes called "elm" and "oak", can I, using all three header files, create a vector <tree> and use push_back to add an "elm" and an "oak" to that vector?
venomlash 55 Junior Poster
Recommended Answers
Jump to Post>If I create a class called "tree" and inherit from it to classes
>called "elm" and "oak", can I, using all three header files, create a
>vector <tree> and use push_back to add an "elm" and an "oak" to that vector?
Polymorphism only works through references, so you'll want a …
Jump to Post>I'm sorry if everyone is starting to be sarcastic with these question
>marks we don't mean anything, hopefully it doesn't offend you?
Yes, please don't take offense? Friendly banter is one of the best things about this forum? But our humor can be a little weird sometimes? Eh? Eh? Yes? …
All 8 Replies
WolfPack 491 Posting Virtuoso Team Colleague
venomlash 55 Junior Poster
Infarction 503 Posting Virtuoso
Narue 5,707 Bad Cop Team Colleague
venomlash 55 Junior Poster
Infarction 503 Posting Virtuoso
John A 1,896 Vampirical Lurker Team Colleague
Narue 5,707 Bad Cop Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.