friend01.c

来自「this is a gcc file, you can download it 」· C语言 代码 · 共 32 行

C
32
字号
// Build don't link://980610 bkoz// example 1: buggyclass foo {public:    class bar;    int func(bar *);    class bar {        int st;    public:        bar(){st=12;}        ~bar(){}        friend int foo::func(bar *);    };    foo(){}    ~foo(){}};int foo::func(bar *obj) {  obj->st++;  return (obj->st);}void test02() {  foo obj_f;  foo::bar obj_b;    obj_f.func( &obj_b);}

⌨️ 快捷键说明

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