using namespace std
来源:互联网 发布:淘宝宝贝排名靠前技巧 编辑:程序博客网 时间:2024/05/22 05:12
using namespace std
在C++编程中使用using namespace std这条指令,就可以在后面的语句中省略std::,不然的话每次使用标准的输入输出函数的时候都要加上std::,例如
#include <iostream>#include "Sales_item.h"int main( ){Sales_item book,note;std::cin >> book>>note;if (book.same_isbn(note)){std::cout << book + note<<std::endl;}else{std::cout << book << std::endl << std::endl;std::cout << note << std::endl;}return 0;}就可以简单写成
#include <iostream>#include "Sales_item.h"using namespace std;int main( ){Sales_item book,note;cin >> book>>note;if (book.same_isbn(note)){cout << book + note<<endl;}else{cout << book << endl << endl;cout << note << endl;}return 0;}
是不是轻盈了很多?
0 0
- using namespace std
- using namespace std
- using namespace std
- 缺少using namespace std;
- using namespace std;问题
- using namespace std 是什么意思?
- using namespace std
- using namespace std
- using namespace std
- using namespace std
- using namespace std
- using namespace std 详解
- C++ using namespace std
- using namespace std
- using namespace std 相关
- using namespace std(转)
- using namespace std
- using namespace std;//C++
- jQuery的ajax async同步和异步介绍
- java面试题二十八 从未用过的 native
- Oracle根据SQL_ID批量收集真实执行计划
- java笔记(三)
- Android Canvas绘图详解(图文)
- using namespace std
- Map---Java双列集合
- Android中自定义圆形图片的CircleImageView和RoundedImageView基本使用效果
- 二分查找
- uml各类图
- USB设备的插入检测
- 完美的CListCtrl控件自绘
- mysql 定时执行存储过程
- 最简单的推送--uexGetui