lisa003.c

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 39 行

C
39
字号
class B {
public:
    int f(int);
};

class D : public B {
public:
    int f(char*);
};



void h(D* pd)
{
    pd->f(1);       // error:
                    // D::f(char*) hides B::f(int)
    pd->B::f(1);    // ok
    pd->f("Ben");   // ok, calls D::f
}



int f(char*);
void g()
{
    extern f(int);
    f("asdf");  // error: f(int) hides f(char*)
                // so there is no f(char*) in this scope
}

void caller ()
{
  void callee (int, int);
  {
      void callee (int);  // hides callee (int, int)
      callee (88, 99);    // error: only callee (int) in scope
  }
)

⌨️ 快捷键说明

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