はcin私は運動のためにコード化された:エラー:のstd '演算子>>' の一致::
Write a complete program that reads an integer from the user,doubles it using the doubleNumber() function,and then prints the doubled value out to the console.
#include <iostream>
int doubleNumber(int x)
{
return 2*x;
}
int main()
{
int a;
std::cout << "Enter an integer :" ;
std::cin >> a >> std::endl;
std::cout << doubleNumber(a) << endl;
return 0;
}
コンパイル中に私が手にエラーがありません:
error: no match for 'operator >>'
アイデア?
'てendlは、' 'のstd :: ENDLをする必要があります;'そして、なぜあなたは 'のstd :: endl'に' '>>使用していますか? – PaulMcKenzie
ありがとうPaulMckenzie。コードは修正後に機能しました。 – NewCoderVini