int main(int argc, char* argv[])
{
struct t_point a, b;
// . . .
return 0;
}
显然,这种方法没有typedef更加直观(在c++中,main函数第一行的struct关键字可以省略,但在标准c中,省略该关键字会出现编译错误)。
此外,对于定义链接队列中的结点,我们可以这样实现:
typedef struct t_node {
int value;
struct t_node *next;
} node;