Why std::cout instead of simply cout?

后端 未结 7 1980
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-30 02:17

I get these error messages for all cout and endl:

main.cc:17:5: error: ‘cout’ was not declared in this scope
main.cc:17:5: note: sugges         


        
7条回答
  •  既然无缘
    2021-01-30 02:41

    Everything in the Standard Template/Iostream Library resides in namespace std. You've probably used:

    using namespace std;
    

    In your classes, and that's why it worked.

提交回复
热议问题