Jump to content

  • Log In with Google      Sign In   
  • Create Account


Class header declared vector is unidentified?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 crovea   Members   -  Reputation: 124

Like
0Likes
Like

Posted 08 June 2012 - 11:45 AM

EDIT: NEVERMIND!! It seems my compiler was hiding the fact that it had a problem with vector not being a member of std. Sorry


Hey i have a probably quick question.

I declared a vector<Zombie*> in my class header, but when i try to access it, i get the error that it's unidentified? This wierds me out as my other variables are perfectly accessible.

My class header:
class ZombieManager
{
public:
	int ZombieHP;
	int nOfZombies;
	std::vector<Zombie*> zombies; //array of zombies!
}



I

in my ZombieManager.cpp
ZombieManager::ZombieManager(int initZombiesSize = 50)
{
  
   int nOfZombies = 0;							 //Works perfectly well

	zombies.reserve(initZombiesSize);	 //error C2065 'zombies' : undeclared identifier
	zombies = new std::vector<Zombie*>;

}

Does anyone have an explanation/solution?

Edited by crovea, 08 June 2012 - 11:50 AM.


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS