码迷,mamicode.com
首页 > 其他好文 > 详细

error: `cout' was not declared in this scope

时间:2018-10-12 01:23:50      阅读:750      评论:0      收藏:0      [点我收藏+]

标签:include   using   原因   c++   name   end   error:   mes   space   

原因:
C++ 1998 要求cout and endl被调用使用‘std::cout‘和‘std::endl‘格式,或using namespace std;

修改后:
#include<iostream>

std::cout << "Hello World!" << std::endl;

或者

 

#include<iostream>
using namespace std;

error: `cout' was not declared in this scope

标签:include   using   原因   c++   name   end   error:   mes   space   

原文地址:https://www.cnblogs.com/ProtoDrive/p/9775858.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!