0
//Vars to know about
Square* square;
vector<Shape> shapes;

I'm trying to add things that are shapes, or in this instance square (which inherits from shape), but whenever I call shapes.push_back(square), I get this error message:

draw.cpp:55: error: request for member ‘push_back’ in ‘shapes’, which is of non-class type ‘std::vector<Shape, std::allocator<Shape> >*’
draw.cpp:57: error: request for member ‘size’ in ‘shapes’, which is of non-class type ‘std::vector<Shape, std::allocator<Shape> >*’
2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by c_shaft05
0

Yay! No errors!! Silly, pointers... still getting used to where to put the * and where not to.

Thanks!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.