Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct new_cls {
- public:
- char &get_hidden_c() {return c;}
- double &get_hidden_d() {return d;}
- int &get_hidden_i() {return i;}
- private:
- char c;
- double d;
- int i;
- };
- char &get_c(Cls &cls) {
- new_cls * newcls= (new_cls *) & cls;
- return newcls->get_hidden_c();
- }
- double &get_d(Cls &cls) {
- new_cls * newcls = (new_cls *) & cls;
- return newcls->get_hidden_d();
- }
- int &get_i(Cls &cls) {
- new_cls * newcls = (new_cls *) & cls;
- return newcls->get_hidden_i();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement