{
enum Season {spring=1,summer,autumn,winter};
enum Season s=summer;//或者S=2
// printf("%d ",s);
return s;
typedef long int INT11;//给数据类型起一个别名
#define URL int//宏替换,原封不动的替换
#define URL_e "www.baidu.com"//宏替换
INT11 a;//long int a;
URL b;//int b;
#pragma mark 宏替换
//宏替换
void typedefOne()
{
typedef long int Int11;//给数据类型long int起一个别名
#define URL int//宏替换,原封不动的替换:Integer1替换int
#define URL_e "www.baidu.com"//宏替换,替换文本,便于批量修改
Int11 a;
URL B;
//区别:
typedef char* String;
#define String1 char*
String name,address;//char *name,char *address;
String1 name1,address1;//char *name,char address;
}
#pragma mark 宏替换结构体
void typedefTwo()
{
typedef struct{
int age;
float height;
} AAA;
AAA xiaoli={23,176.5};
AAA xiaozhang;
}
#pragma mark 宏替换枚举
void typedefThree()
{
typedef enum{spring=1,summer,autumn,winter} Season;
Season s1=summer;
Season s2=winter;
}
//***************************************************//
//枚举(从1开始计算,以后一次加1)
int season=enumOne();
switch (season) {
case 1:
printf("spring");
break;
case 2:
printf("summer");
break;
case 3:
printf("autumn");
break;
case 4:
printf("winter");
break;
default:
break;
}