C++ cout gives undeclared identifier

前端 未结 5 716
闹比i
闹比i 2021-01-18 11:33

So, I have this question. Why does cout throws

error C2065: \'cout\' : undeclared identifier

I am using Visual Studio 2012 as an IDE and I

5条回答
  •  终归单人心
    2021-01-18 11:54

    stdafx.h shall be the first include directive in your source file.

    Switch files and convert the second include to <>, as other suggested.

    #include "stdafx.h"
    #include 
    

    See this post for more information.

提交回复
热议问题