问一个极新手的问题,关于类外的函数。
我在demo里建了两个类:
GameTwentyFour.h
GameTwentyFour.cpp
和
ServerControl.h
ServerControl.cpp
GameTwentyFour.cpp 代码如下:
void TestFunc(char name[]);GameTwentyFour::GameTwentyFour(void){}GameTwentyFour::~GameTwentyFour(void){}int GameTwentyFour::StopGame(void){ TestFunc("GameTwentyFour"); return 0;}void TestFunc(char str[]){ cout<<"*********************************** "<<str<<" ************************************"<<endl;}
ServerControl::ServerControl(void){}ServerControl::~ServerControl(void){}int ServerControl::Show(void){ TestFunc("ServerControl"); return 0;}