[原创]#include
#include <iostream.h>class A
{
float m;
public:
operator float()
{
}
};
void main()
{
A obj;
float f;
f=obj;//->f=(float)obj;->f=obj.float();
}
#include <iostream.h>
class Sample;
class M
{
private:
int n;
public:
void Set(Sample);
};
class Sample
{
private:
int money;
public:
Sample()
{ money =10; }
friend void M::Set (Sample s);
void Disp()
{
cout<<money<<endl;
}
};
void M::Set(Sample obj)
{
n= obj.money ;
}
void main()
{
Sample s;
M obj;
obj.Set (s);
s.Disp ();
}