Yep, just covered polymorphism. And I understand what I read, but the example I read only used a method that all derived classes could use. So I'm trying to figure out how best to handle methods that are specific to derived classes. The instructor's texts focus on pointers, so I figured I had to use them for the isolated methods as well as the base methods.
This is an online class, which is bad enough, cause it's a 16 week course in 8 weeks. But there's no real interaction with the instructor unless you email him. Otherwise we just look over this weeks notes and them do the project. To ask questions, we email him and wait a day for the response. It's way less efficient to email the instructor and wait for a response from one person than to ask a forum. So thanks for the replies, everyone! I appreciate the input!
Yes, the base value for the triangle will be set by the user in the program. I have a rectangle with width and height, a Triangle with base and height, and a Circle with radius and a constant, pi. I could change the triangle's base to width, but I still have unique variables in circle, so why bother.
The user creates multiple different shapes and sets the values at creation. The shapes go into an STL.
So is it best to just use the derived class's methods directly? Or is there a more pointer-y way to do this more efficiently?
Code:
http://pastebin.com/AG1mWMqi