为了账号安全,请及时绑定邮箱和手机立即绑定

namespace的范围?

#include <stdlib.h>
using namespace std;
void fun(int i = 30, int j = 20, int k = 10);
int main(){
        fun();
        fun(100);
        fun(200);
        fun(300);
}
void fun(int i, int j, int k)
{
        cout << i << "," << j << "," << k << endl;
}

error: 'cout' was not declared in this scope

error: 'endl' was not declared in this scope

这是什么情况

正在回答

1 回答

谢采纳,

C++的标准输入输出库的头文件是iostream

使用它的方式为:

#include <iostream>

这行代码放在头文件下面。

以上。

1 回复 有任何疑惑可以回复我~
#1

夕苜 提问者

非常感谢!
2018-07-19 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
C++远征之离港篇
  • 参与学习       122700    人
  • 解答问题       474    个

C++扫清通往面向对象的最后一道障碍,将所有知识点融会贯通

进入课程

namespace的范围?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信