- #1
AKJ1
- 43
- 0
Homework Statement
[/B]
Hi all, these were two even numbered exercises in my C++ textbook. I am self teaching the language so I am trying to get some of the basics down.
1. Would the following snippet of code best be described as an example of Polymorphism or Inheritance?
class Shape { public: void draw();
protected:
Shape();
virtual void drawPoints() const = 0;
private:
std::vector points;
};
2. What is the difference between
int list[10];
std::vector<int> list(10);
The Attempt at a Solution
[/B]
My answer to the first question is inheritance, but if I am incorrect please let me know, thank you.
The second question I am sort of lost on, the second piece of code creates a vector of 10 ints called list. What does "int list[10]" do?
Thank you!
Last edited: