大家帮帮忙,看看这是什么错误,如何修改?
error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'class ostream &(__cdecl *)(class ostream &)' (or there is no acceptable conversion)
Error executing cl.exe.
程序如下:
#include<iostream.h>
#include<math.h>
class convert
{
public:
convert(int m);
private:
int m;
};
convert::convert(int m)
{int a[16], b[16];
int i=0,j=0,k=0;
double s=0.0;
b[0]=m;
while(i<=4)
a[i]=b[j]%2;
b[j+1]=b[j]/2;
i++;
j++;
for(i=3;i>=0;i--)
s=s+a[k]*(pow(2,k));
k++;
}
void main()
{int d;
cout<<"请输入16进制数:"<<endl;
cin>>d>>endl;
convert con(d);
}