#define PI 3.14
const float PI=3.14;
#define M (2+3)
M*M --> (2+3)*(2+3)
#define MAX(a,b) ((a) > (b) ? (a) : (b))
int MAX(int a,int b)
{
return a > b ? a : b;
}
#define INT float
INT i; ---> float i;
typedef int INT;
INT i ---> int i;
typedef struct student
{
int id;
char name[NAMESIZE];
int math;
}STUDENT;
typedef struct student STUDENT;
STUDENT stu ; ---> struct student stu;
typedef struct student * STUP;
STUP p; ----> struct student *p;
//-----------------------------------
diff:typedef define
#define INTP int *
typedef int *INTP;
INTP p,q;---> int *p,q;
INTP p,q;---> int *p,*q;
//------------------------------------
typedef int ARR[3];----> int [3] -->ARR
ARR arr;---> int [3] arr;--->int arr[3];
typedef int FUN(int); --->int (int) FUN;
FUN fun1,fun2;---> int fun1(int); int fun2(int);
typedef int (*FUNP)(int); --->int (*)(int) FUNP;
FUNP p;--->int (*p)(int);
void qsort(void *, size_t , size_t ,
int(*compar)(const void *, const void *));
---->
typedef int(*compar)(const void *, const void *);
void qsort(void *, size_t,size_t, compar cmp);
阅读(642) | 评论(0) | 转发(0) |