// #define Integer int标签:typedef,Point,int,OC,char,使用,Integer,String1 From: https://blog.51cto.com/u_15907570/5925302
// 给基本数据类型起别名
void
typedef int
typedef Integer
typedef unsigned int UInteger;
int a = 10;
Integer b = 9;
UInteger c = 11;
MyInteger d = 89;
}
// 给指针类型起别名
void
char *s = "hello";
typedef char
String s1 = "hello";
}
void
typedef struct {
float
float
} Point;
Point p = {10, 10};
}
void
typedef struct {
float
float
} Point;
typedef Point
// typedef struct Point {
// float x;
// float y;
// } * PP;
Point point = {10.0f, 20.0f};
PP
printf("x=%f, y=%f\n", pp->x, pp->y);
}
void
typedef enum {
spring,
summer,
autumn,
winter
} Season;
Season s = spring;
}
int sum(int a, int
int
printf("%d+%d=%d\n", a, b, c);
return
}
// 给指向函数的指针定义一个别名SumPoint
void
typedef int (*SumPoint)(int, int);
SumPoint p = sum;
4, 5);
}
void
typedef char
#define String2 char *
String1
// String1 s1;
// String1 s2;
String2
// char *s3, s4;
// char *s3;
// char s4;
}
int main(int argc, const char
{
int
// int a;
// int b;
return 0;
}