This is definitely really simple. I have been out of C++ for a few years, so I need some help with figuring out why this won’t compile.
I have a class called ‘PointList’. In the header file, I have the following:
public:
PointList();
private:
std::vector< Point* > *pl;
In the .cpp file, I have the following:
PointList::PointList()
{
pl = new vector< Point* >();
}
This does not compile.
Expected type-specifier before ‘vector’
Cannot convert ‘int*’ to ‘std::vector <*’ in assignment
expected ‘;’ before ‘vector’
What gives?
Are you using
usingdeclarations. If not you need to prefixvectorwithnamespace std::in your cpp file