C++能提高程序的运行效率,节约更多的资源。
C++是编程语言的联盟
bool
C语言中使用bool需要引<stdbool>,定义了0和1分别为true和false
C++中 ,bool和int可以相互转化
int -> bool 0为false,非0为true
bool -> int true ==1 false==0
const
将变量常量化,编译器在语法层面上进行检测。
使用#define 定义的都是真常量
域运算符 Domain Operator
#include<iostream> //标准C++库
#include<stdio.h>//c 继承来的
#include<cstdio>//C 继承来,符合 C++标准
int num =100; //占用全局空间
int main()
{
int num =10; // 栈空间