Trying to create a vector of cSquare however I am having difficulties as the class states it needs to be initalised? How would one go about doing that considering if it wasn't in the class I would not need two?
Hi thank you for the reply however I have done what you have said but I still receive a Visual Studios error saying the follow:
Error 2 error C2664: 'void std::vector<cSquare *,std::allocator<_Ty>>::push_back(cSquare *const &)' : cannot convert argument 1 from 'int' to 'cSquare *&&' c:\users\connor\documents\visual studio 2013\projects\monopolyassignment\cplayer.cpp 11
Error 1 error C2758: 'cPlayer::vOwnedProperties' : a member of reference type must be initialized c:\users\connor\documents\visual studio 2013\projects\monopolyassignment\cplayer.cpp 7
Here is what the player.cpp looks like where the errors are.
// using namespace std; // avoid in header files
class cPlayer
{
// vector<cSquare*>& vOwnedProperties;
std::vector<cSquare*> vOwnedProperties ; // not a reference
// ...
};