class A { public: string x; A():x("kdf"){} }; class B:public A { public: B(int i):y(i){} int y; }; int _tmain(int argc, _TCHAR* argv[]) { A a; cout <<((B&)a).y; return 0; }
class A { public: string x; A():x("kdf"){} }; class B:public A { public: B(int i):y(i){} int y; }; int _tmain(int argc, _TCHAR* argv[]) { A a; cout <<((B)a).y; return 0; }
cout <<((B)a).y;
C
A
B
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)