2021年4月7日星期三

I'm having problems setting the name with SetCharacterName();

main.cpp

C_Character C    void main() {      C.SetCharacterName(C.c1,"Natasha");        //game loop      while (true) {          std::cout << C.c1.Name << std::endl;          std::cout << C.c1.Age << std::endl            system("CLS");      }  }  

Class.cpp

void C_Character::SetCharacterName(m_Character c,std::string NewName)  {      c.Name = NewName;  }  

Class.H

class C_Character  {  public:      struct m_Character      {          std::string Name;          int Age;          float Weight;          float height;      };        m_Character c1;        void SetCharacterName(m_Character c ,std::string NewName);  }  
https://stackoverflow.com/questions/66996380/im-having-problems-setting-the-name-with-setcharactername April 08, 2021 at 10:03AM

没有评论:

发表评论