-5
我正在尝试编写一个程序,该程序在键入load
时在控制台中显示自定义消息。但我似乎无法让它工作。 :/无法理解if命令
#include "stdafx.h"
#include "iostream"
#include "string"
using namespace std;
int main()
{
int commands();
string text;
cout << "Write your registered e-mail to continue...\n";
cin >> text;
string input;
cout << "\n";
cout << "Welcome " << text << endl;
cout << "\n";
cout << "www.steamcommunity.com/id/thetraderdazz> ";
cin >> input;
if (input = load);
cout << "loading...";
system("pause");
return 0;
}
这也给了我下面的错误:
identifier "load" is undefined.
你似乎有对C++的不少误解。你应该退后一步,系统地从一本好书中学习语言。 –
同意上面的评论。这里有一些你的特定问题的帮助https://stackoverflow.com/questions/6222583/how-to-compare-strings – ivo
我同意上面的所有意见,但首先,你应该使用strcmp函数而不是'=' (它的作用,我认为你的意思是'=='),你必须使'load'成为一个字符串,所以:''load''。 –