I'm making a game and running into a weird problem.... I'm trying to make a vector of pointers to another class I created, "character" class. I'm actually trying to make two, but for some reason it won't let me make two, one of them raises the error "vector does not name a type" but if I comment either one of them out then the other will work just find. Any idea why?? Heres the code.
#include "Character.h"
#ifndef GAMEBASE_H
#define GAMEBASE_H
class GameBase
{
public:
GameBase();
void initialize_teams();
void Move ( constshort x, constshort y );
void Battle ( int index_attack, int index_defend );
voidprotected:
private:
vector<Character*> Team_One;
vector<Character*> Team_Two;
Board* field;
#endif // GAMEBASE_H
I tried adding scope operator but it didn't work either. I'm at a loss, I was excited to get away from arrays because of the convenience but this is not more convenient as of yet lol.
edit: thanks for the help everybody.. I didn't know that it required namespace std to work. yup
I lied it actually doesn't work at all. I seriously have no idea why it's not working. This is my first time trying to use vectors so I could just be doing something wrong. An array of type pointer to characters works just fine. Is storing user created types in vectors not a feature my compiler supports maybe??