intmain(){ { Sub sub; Base base = sub; sub.execute(); // Sub execute base.execute(); // Base execute sub.vexecute(); // Sub virtual execute base.vexecute(); // Base virtual execute sub.hexecute(0); // Sub hide execute 0 // sub.hexecute(); no matching function for call to ‘Sub::hexecute()’ base.hexecute(); // Base hide execute // base.hexecute(0); no matching function for call to ‘Base::hexecute(int)’ sub.vhexecute(0); // Sub hide execute 0 // sub.vhexecute(); no matching function for call to ‘Sub::vhexecute()’ base.vhexecute(); // Base hide execute // base.vhexecute(0); no matching function for call to ‘Base::vhexecute(int)’ }{ Sub sub; Base &base = sub; sub.execute(); // Sub execute base.execute(); // Base execute sub.vexecute(); // Sub virtual execute base.vexecute(); // Sub virtual execute sub.hexecute(0); // Sub hide execute 0 // sub.hexecute(); no matching function for call to ‘Sub::hexecute()’ base.hexecute(); // Base hide execute // base.hexecute(0); no matching function for call to ‘Base::hexecute(int)’ sub.vhexecute(0); // Sub hide execute 0 // sub.vhexecute(); no matching function for call to ‘Sub::vhexecute()’ base.vhexecute(); // Base hide execute // base.vhexecute(0); no matching function for call to ‘Base::vhexecute(int)’ }{ Sub *subp = newSub(); Base *basep = subp; subp->execute(); // Sub execute basep->execute(); // Base execute subp->vexecute(); // Sub virtual execute basep->vexecute(); // Sub virtual execute subp->hexecute(0); // Sub hide execute 0 // subp->hexecute(); no matching function for call to ‘Sub::hexecute()’ basep->hexecute(); // Base hide execute // basep->hexecute(0); no matching function for call to ‘Base::hexecute(int)’ subp->vhexecute(0); // Sub hide execute 0 // subp->vhexecute(); no matching function for call to ‘Sub::vhexecute()’ basep->vhexecute(); // Base hide execute // basep->vhexecute(0); no matching function for call to ‘Base::vhexecute(int)’ delete subp; } return0; }