Did I answer correctly?

Would you agree that I answered these conceptual questions about struct and polymorphism correctly?

struct allows:
a)member function definition
b)virtual constructors & inheritance
c)public & private visibility specifiers

I chose all of the above

polymorphism allows:
a)create collection of derived classes that are of different types
b)override base class behavior using virtual functions
c)share common data variables via base class

I chose c) only
your answer to the first question is correct.

the answer to the second question should be b).

your choice of c)
"share common data variables via base class" would define inheritance.
Last edited on
I looked at this link:
http://www.cplusplus.com/forum/beginner/2530/

"The advantages are
1) it reduces overhead when handling multiple objects of similar type.
2) it allows new objects to be added to previously written code without modifying the original code.
3) it keeps private stuff private.
4) it is easier to maintain large systems"

would polymorphism be a)?
I just now noticed that the question says 'allows'. Unfortunately neither a b or c 'clearly' convey what polymorphism allows. a) would be the (closest) answer.

I originaly chose the answer b) since virtual methods is what allows polymorphism.
ok thanks for helping out
Topic archived. No new replies allowed.