-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''。 –