error C2679: binary ‘>>’ : no operator defined which takes a right-hand operand of type ‘’ (or there is no acceptable conversion)
例如以下程序:
1. #include<iostream>
2. using namespace std;
3. int main()
4. {
5. int a,b,c;
6. cout<<"请输入三个整数"<<endl;
7. cin>>a>>b>>c>>endl;
8. cout<<a<<b<<c<<endl;
9. return 0;
10. }
错误在第7行cin>>a>>b>>c>>endl;中,最后一个>>没有输入对象,又不需要endl换行,只有输出语句才能换行,解决方法是删掉 >>endl 即可。