I almost hate to post this as i'm new to c++ but i am having touble with pulling data out of an array.
I have 4 classes: Shape, circle, square, triangle. (they inherit from shape) Each class has unique functions. (eg. getRadius.)
I have an array: shapes which contains circles, squares, and triangles.
How do i tell what object type i am working with when i get it out of the array? Everything is coming out type shape and i cannot access the specific values of each class.
I have 4 classes: Shape, circle, square, triangle. (they inherit from shape) Each class has unique functions. (eg. getRadius.)
I have an array: shapes which contains circles, squares, and triangles.
How do i tell what object type i am working with when i get it out of the array? Everything is coming out type shape and i cannot access the specific values of each class.