1. 程式人生 > 其它 >bug記錄

bug記錄

#include <iostream>
#include <stdio.h>
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; }