c bool 类型 是宏定义
#define false 0
#define true 1
#define bool int
这种定义是狭义的
c++ 的bool定义是
false 0 于上面没区别
ture 为非0值
这种定义是广义的
后来 c98 增加一个 _Bool 需要包含头文件 stdbool.h
false 为 0;
true 为非零
#include<iostream>
#include<stdlib.h>
using namespace std;
int num=10;
namespace poedu
{
int num=30;
}
int main()
{
int num=20;
cout<<num+::num+poedu::num;
system("PAUSE");
}
域作用符之前为空时候代表全局变量,命名空间用来访问指定的空间
C语言:mailoc free (函数)
C++:new delete (运算符不是函数)
int *pNum=new int(100);
delete pNum;
int *pArray=new int[100];
delete []pArray;