c++基础之语言新特性

来源:互联网 发布:少儿编程 比尔盖茨 编辑:程序博客网 时间:2024/06/03 04:22

//学习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;}


运行结果:


0 0
原创粉丝点击