Hello all
I'm somewhat new to C++ and have run into a snag passing a char array into a function. I am using the Borlans C++BuilderX
Compiler.
I get this error:
"character.h": E2277 Lvalue required in function Character::SetName(char *)
Thanks for any help.
Following is the source.
Code:class Character { protected: char m_szName[30]; int m_iRace; int m_iClass; Stat* m_pStats[6]; public: Character(); ~Character(); // The problen function void SetName(char* szName) { m_szName = szName; }; void SetRace(int iRace) { m_iRace = iRace; }; void SetClass(int iClass) { m_iClass = iClass; }; void SetStats(int iStat, int iScore, int iWhich); char* GetRace(); char* GetClass(); int GetStat(int iStat, int iWhich); };



LinkBack URL
About LinkBacks


