【发布时间】:2013-07-17 13:03:48
【问题描述】:
#include <iostream>
#include <math.h>
#include <conio.h>
using namespace std;
class hugeint
{
public:
int size;
int number[100];
friend istream& operator>>(istream&,hugeint&);
friend ostream& operator<<(ostream&,hugeint&);
};
istream& operator>>(istream& in,hugeint& c)
{
// code not shown
return in;
}
ostream& operator<<(ostream& out,hugeint& c)
{
return out;
}
void main()
{
system( "color 70" );
hugeint o;
hugeint y;
hugeint z;
cin >> o;
cout<<"now y "<<endl;
cin>>y;
}
编译器抱怨operator >> 模棱两可……我该怎么办?
【问题讨论】:
-
它给出的错误是运算符 >> 模棱两可...我该怎么办?
-
请修复您的源代码,使其真正可以运行。
-
main在 C++ 中需要返回类型为int。 -
您不应该在
C++中包含C标头,而应使用C++版本,例如#include <math.h>->#include <cmath>。 -
main()必须返回int。
标签: c++ visual-c++ iostream