C++ cout gives undeclared identifier

前端 未结 5 739
闹比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 12:11

    If you use #include with the <> instead of "" then it should work. Right now, the compiler doesn't know where to find the iostream library.

    Also, you might want to change cout<<"example"; to cout<<"example"< for a new line so that it formats correctly.

提交回复
热议问题