您的位置:首页 > 编程语言 > C语言/C++

c++基础之语言新特性

2017-04-01 18:49 260 查看
//学习c++中的笔记。

一、c++环境

vs2012或者codeblocks

二、新特性

1.变量随用随定义

2.输入cin,输出cout

3.namespace用户自定义

 样例:

#include <iostream>
using namespace std;
namespace A
{
int x;
void fun()
{
cout<<"namespace A"<<endl;
}
}
namespace B
{
int x;
void fun()
{
cout<<"namespace B"<<endl;
}
}
int main()
{
A::fun();
B::fun();
return 0;
}


运行结果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: