1 | #include <stdio.h> |
---|---|
2 | |
3 | namespace namesp |
4 | { |
5 | class Virtual { |
6 | public: |
7 | virtual void doSomething() { |
8 | printf (format: "namesp function did something.\n"); |
9 | } |
10 | }; |
11 | } |
12 | |
13 | class Virtual { |
14 | public: |
15 | virtual void doSomething() { |
16 | printf(format: "Virtual function did something.\n"); |
17 | } |
18 | }; |
19 | |
20 | int |
21 | main() |
22 | { |
23 | namesp::Virtual my_outer; |
24 | Virtual my_virtual; |
25 | |
26 | // Break here to get started |
27 | my_outer.doSomething(); |
28 | my_virtual.doSomething(); |
29 | |
30 | return 0; |
31 | } |
32 | |
33 |