//函数重载
class Myclass
{
public:
int Print(int x)
{
i=x;
return i;
}
float Print(float x)
{
f=x;
return f;
}
double Print(double x)
{
d=x;
return d;
}
int * Print(int *x)
{
a=x;
return a;
}
float * Print(float *x)
{
b=x;
return b;
}
double * Print(double *x)
{
c=x;
return c;
}
private:
int i;
float f;
double d;
int *a;
float *b;
double *c;
};
//调用
int main()
{
int i=2;
float f=2.2f;
double d=2.212;
int a[5]={1,2,3,4,5};
float b[5]={1.2f,2.2f,3.2f,4.2f,5.2f};
double c[5]={1.212,2.212,3.212,4.212,5.212};
Myclass p;
cout<
只写一个函数?