我的可用分已经没了,不能给分了,希望好心人进来帮我看看这个问题。
z33 2003-01-10 09:50:25 //----Round.h
class Round:public Shape //定义圆类
{
public:
Round(int r=0){m_r=r;}; //构造函数
double Getzou(); //计算周长
double Getmain(); //面积
// char* toString(); //输出字符串
int Getr(); //返回半径
private:
int m_r; //圆的半径
};
//---------CMain.cpp
#include <iostream.h>
#include "shape.h"
void main()
{
int r;
Round ro(5);
r=ro.Getr;
cout<<"hi "<<PI<<r<<endl;
}
编译出错,可我不知道错在哪儿,各位大哥帮帮忙,谢谢。
Compiling...
cMain.cpp
l:\cpp_shape\maker\cmain.cpp(8) : error C2440: '=' : cannot convert from 'int (__thiscall Round::*)(void)' to 'int'
Conversion is a valid standard conversion, which can be performed implicitly or by use of static_cast, C-style cast or function-style cast
Error executing cl.exe.
cMain.obj - 1 error(s), 0 warning(s)