C++?麯????????
???????????? ???????[ 2015/9/28 11:08:41 ] ?????????麯?? ???????????
??????????????????
1 class B
2 {
3 public:
4 virtual void fun(int i = 1)
5 {
6 std::cout << "base fun called?? " << i;
7 };
8 };
9
10 class D : public B
11 {
12 private:
13 virtual void fun(int i = 2)
14 {
15 std::cout << "driver fun called?? " << i;
16 };
17 };
??????????????2?????
????B* p = new D();
????p->fun();
????????? driver fun called?? 1
?????????????????????
??????1?????????????????????????к???????????????????
??????2???麯??????????????????????????????????
?????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11