新手求助,error C2676: binary '>>'
错误是:
num5.cpp
E:\C++_Projects\TestVC6\num5.cpp(6) : error C2676: binary '>>' : 'class std::basic_ostream<char,struct std::char_traits<char> >' does not define this operator or a conversion to a type acceptable to the predefined operator
Error executing cl.exe.
什么意思啊?
我有自学过Java,现在学校开C++这门课,第一天用vc++6.0,让我感觉非常非常非常的别扭与不方便......
==================================================================================================
为什么会有这样的错误呢?
我的工程里就两个c++程序,一个num4.cpp
#include<iostream>
using namespace std;
struct Point {
int x, y;
};
void main() {
int result;
Point p;
cout <<"请出入两个整数:";
cin >>p.x >>p.y;
result = p.x * p.y;
cout <<p.x <<" * " <<p.y <<" = " <<result <<endl;
}
一个num5.cpp
#include<iostream>
using namespace std;
void main() {
int a;
cin >>a;
cout >>a;
}
第一天就这样,让我对vc好失望啊,...很怀念java的Myeclipse......