pmf1.c

来自「gcc-you can use this code to learn somet」· C语言 代码 · 共 19 行

C
19
字号
// Based on a test case by Andrew Bell <andrew.bell@bigfoot.com>// Check for pointer-to-virtual-function calls on // bases without virtual functions.struct B{};struct D: public B{  virtual void foo();};void D::foo(){}int main(){  B *b = new D;  void (B::*f)() = static_cast<void (B::*)()>(&D::foo);  (b->*f)();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?