(1)使用#define 宏定义;
(2)使用const关键字。
使用#define注意不要试图把 "{" , "main" 等进行替换。以及句末不需要加分号。后面的类型一定要是可以识别的。
#define age 20
const int age 20;
#include<iostream>
#define e "Hello World"
#define age 600
using namespace std;
int main(){
printf("%d",age);
printf(e);
//注意还是要使用占位符%d
}