下面程序用于输出最小值,有一处错误。
#include < iostream.h >
class Test
{ int a, b;
int getmin()
{return (a<b a:b);}
public:
int c;
void setValue( int x1, int x2, int x3 )
{ a =x1; b =x2; c =x3;}
int GetMin();
};
int Test::GetMin()
{ int d = getmin ();
return (d=d<c d:c);
}
void main()
{ Test t1;
t1.setValue(34,6,2);
cout << t1.getmin () << endl;
}