Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cassert>
- class A {
- public:
- int f () {
- return 5;
- }
- int g () {
- return f() * f();
- }
- };
- class B:A {
- public:
- int f () {
- return 6;
- }
- };
- int main () {
- assert(B().g() == 36);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement