hello, i have been wondering something about vectors..
(if anyone needs code let me know)
alright heres my question with a bit of an explination:
i have made an item class in its own header file. i also have made a player class in its own header file. they both have child classes of their own(doesnt matter much)
so heres my question:
is it possible to make a vector of the item class in the player class like this:
1 2 3 4 5
|
class Player
{
vector<Item*> Inventory;
//other stuff
}
|
when i tried this out, i got an error saying that 'Item' was not declared i this scope.
so im wondering if this is the wrong way of doing this?
what im trying to do is make a vector for the items at the same time make it for only that player
it would be nice to provide some code explaining how. xD
thanks in advance