bug记录


#include 
#include 
using namespace std;

class testC
{
public:
    void test()
    {
        printf("hello!");//printf函数为库函数,在类内是不可见的,写成这样如果在会输出错误结果
        //不加冒号的一定是当前作用域可见的所有的函数或者变量,否则报错,
        //加冒号的可以一用冒号前的那个类或者命名空间里的函数或变量,否则一般是不能用的(双冒号前不加东西是全局变量或函数的意思)
    }
    void printf(const char *string)
    {
        cout << "test::printf:hello!";
    }
};
int main(){                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
    testC c;
    c.test();
    //c.printf("hello");
    return 0;
}

相关