C++初始化两种方法
1,int x=1024;
2, int x (1024);
C++新特性输出
cout<<oct<<A<<endl;
8进制输出
cout<<dec<<A<<endl;
10进制
cout<<hex<<A<<endl;
16进制
bool类型 false、true
bool A=1;
cout<<boolalpha<<A;
命名空间 namespace
using namespace std;(自动将cout等function、参数从std空间中使用,适用多次使用)
std中有cout、cin
namespace A
{
int x=2;
}
namespace B
{
int x=3;
}
cout<<A:x<<endl;