I want to make a pointer to an instance of a class. Many instances - that is why I made an array which saves all of those. But how can I set the value of a pointer in a class to 0? That is the code... Maybe you know what I'm talking about
public:
CCharacter *pTeamMember[15];
And in another file:
pTeams[team]->pTeamMember = 0;
It causes following error.
error C2440: '=' can't convert 'int' into 'CCharacter *[15]
What I don't understand is, that this don't causes any errors:
public:
Team *pTeams[31];
And in another file:
pTeams[i] = 0;
Does anyone have ideas?
CCharacterandTeam?pTeams[team]->pTeamMember[member] = 0;(member being the corresponding index)std::vector<CCharacter *>or even better, a vector ofunique_ptrorshared_ptr.