#include
"
stdafx.h
"
#include < iostream >
using namespace std;
class Base
... {
public :
virtual Base& operator=(const Base& a)
...{
cout<<"Base ="<<endl;
return *this;
}
} ;
class Devide: public Base
... {
public :
virtual Base& operator=(const Base& a)
...{
cout<<"Devide =(override)"<<endl;
return *this;
}
Devide& operator=(const Devide& d)
...{
cout<<"Devide="<<endl;
return *this;
}
} ;
int _tmain( int argc, _TCHAR * argv[])
... {
Devide dObj1;
Devide dObj2;
/**//* Base bObj = dObj1;
Base &bObjRef = dObj1;*/
Base bObj ;
Base &bObjRef = dObj1;
bObj = dObj2;
bObjRef = dObj2;
dObj2 = dObj1;
return 0;
}
#include < iostream >
using namespace std;
class Base
... {
public :
virtual Base& operator=(const Base& a)
...{
cout<<"Base ="<<endl;
return *this;
}
} ;
class Devide: public Base
... {
public :
virtual Base& operator=(const Base& a)
...{
cout<<"Devide =(override)"<<endl;
return *this;
}
Devide& operator=(const Devide& d)
...{
cout<<"Devide="<<endl;
return *this;
}
} ;
int _tmain( int argc, _TCHAR * argv[])
... {
Devide dObj1;
Devide dObj2;
/**//* Base bObj = dObj1;
Base &bObjRef = dObj1;*/
Base bObj ;
Base &bObjRef = dObj1;
bObj = dObj2;
bObjRef = dObj2;
dObj2 = dObj1;
return 0;
}