I'm looking through some code examples, and although I've been working through a C++ tutorial and think I've got the hang of pointers I've come across something I don't understand. The code I'm looking at is a player class from the Wrathlands source -
class PLAYER: public ENTITY
{
private:
int strength;
int intelligence;
int level;
WEAPON weapon;
ARMOR armor;
POTION* potionlist[15];
SPELL* spelllist[10];
public:
PLAYER();
void SetStrength(int newstr);
int GetStrength();
void SetIntelligence(int newint);
int GetIntelligence();
void SetLevel(int newlevel);
int GetLevel();
WEAPON* GetWeapon();
void SetWeapon(WEAPON weapon);
ARMOR* GetArmor();
void SetArmor(ARMOR armor);
void AddPotion(POTION* potion);
POTION** GetPotionList();
void AddSpell(SPELL* newspell);
SPELL** GetSpellList();
void CheckForLevelUp();
};
What I don't get is the lines like
POTION* potionlist[15];
as in the pointer tutorial it didn't have things with the asterix on the end of a word like this.
Can someone explain what this does? It may weel be something I haven't covered yet but I'm trying to follow the things I learn in examples like this so I can relate what I learn to real world uses, as this helps me learn things a lot better.