假设:用户输入颜色值来设定窗口颜色:
#include "pch.h"
#include <iostream>
//const int white = 0;
//const int black = 1;
//const int red = 2;
//const int blue = 3;
//const int green = 4;
//typedef给一种类型起别名
typedef int COLOR;//好处就是后面如果想把int改成char等等就可以直接在这里改typedef char COLOR;而不用再一个个去改!
const COLOR white = 0;
const COLOR black = 1;
const COLOR red = 2;
const COLOR blue = 3;
const COLOR green = 4;
void SetWindowColor(COLOR color);
const char* Colors[5] = {
"white" ,"black","red","blue","green"};
int main