于对
typedef struct tagpoint{
float x, y;
int z;
}point,*ppoint;
首先可以分解为:
typedef struct tagpoint{
float x, y;
int z;
}point;
typedef struct tagpoint{
float x, y;
int z;
}*ppoint;
上面的一个好理解就是相当于typedef
struct tagpoint point,给结构体
struct tagpoint 取另一个名字叫point.(注意:
struct tagpoint 才代表结构体 不是tagpoint)。
下面一个可以理解为:
struct tagpoint{
float x, y;
int z;
};
typedef struct ttagpoint *ppoint;
视乎这条语句不太好理解,首先看看这样的定义:
const char * apoint 定义一个指向char类型的指针变量。其实是这样看的:
const
char *
apoint (
const
char *
apoint 效果是一样的)
那么就有:
typedef
struct ttagpoint *
ppoint; C语言规定空格在哪都可以。
这样看就明白了,
typedef
struct ttagpoint *
ppoint
是为结构体指针取另外一个名字叫ppoint。