簡體   English   中英

stdafx.h可能會否定iostream

[英]Possible negation of iostream by stdafx.h

當我嘗試使用Visuale Studios(2017社區)進行構建時
我收到一個錯誤消息,告訴我包括“ stdafx.h”(代碼C1010)
當我這樣做時,我遇到幾個問題,告訴我我有琴弦
沒有定義,其他問題通常只會在我發生時發生
忘記iostream。 這是我使用過的唯一編譯器,但是在線編譯器似乎可以工作( https : //onlinegdb.com,http://cpp.sh

#include <iostream>
#include <string>
using namespace std;
int main()
{
string var1;
std::string pass;
std::cout << "Enter Any word" << std::endl;
std::cin >> pass;
cout << "1.what is 9 x 9" << endl;
std::cin >> var1;
cout << "2.what is 9 x 8" << endl;
std::cin >> var1;
cout << "3.what is 19 x 2" << endl;
std::cin >> var1;
cout << "4.what is 27 x 10" << endl;
std::cin >> var1;
cout << "5.what is 87 x 90" << endl;
std::cin >> var1;
cout << "6.what is 989 + 10" << endl;
std::cin >> var1;
cout << "7.What languages can Putin speak" << endl;
std::cin >> var1;
cout << "8.what is the square of 100" << endl;
std::cin >> var1;
cout << "9.What is the first word in the family guy theme song" << endl;
std::cin >> var1;
cout << "What is the answer to #5" << endl;
std::cin >> var1;
cout << "What is the answer to #7" << endl;
std::cin >> var1;
cout << "What is the answer to #9" << endl;
std::cin >> var1;
cout << "what is 989 + 10" << endl;
std::cin >> var1;
cout << "what was your word?" << endl;
cin >> var1;
if (var1 == pass)
{
    cout << "correct";
}
else
{
    cout << "wrong, you stynk";
}
}

您可以通過轉到項目屬性-> C / C ++->預編譯頭,然后選擇不使用創建禁用預編譯頭

或者,包括"stdafx.h"並將其他包含移動到該文件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM