Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
513 views
in Technique[技术] by (71.8m points)

c++ - Error: signature of public member contains native type 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'

I'm trying to create a public function with a variable inside a function name.

GamePlayer.xaml.cpp:

string whatGame = "nothing";

string GamePlayer::changeGame(string gameName)
{
   whatGame = gameName;
   return gameName;
}

GamePlayer.xaml.h:

public:
string GamePlayer::changeGame(string gameName);

But, output returns this error:

'changeGame': signature of public member contains native type 'std::basic_string<char,std::char_traits,std::allocator>'

What I have to do?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...