error C2065: 'cout' : undeclared identifier

前端 未结 25 2224
误落风尘
误落风尘 2020-12-01 08:40

I am working on the \'driver\' part of my programing assignment and i keep getting this absurd error:

error C2065: \'cout\' : undeclared identifier

25条回答
  •  情书的邮戳
    2020-12-01 09:40

    Take the code

    #include 
    using namespace std;
    

    out of your .cpp file, create a header file and put this in the .h file. Then add

    #include "whatever your header file is named.h"
    

    at the top of your .cpp code. Then run it again.

提交回复
热议问题