<分区>
Possible Duplicate:
Purpose of struct, typedef struct, in C++
typedef struct vs struct definitions
我知道在 C 中有两种声明结构的方法
struct point{
int x, y;
};
和:
typedef struct{
int x, y;
} point;
但是这两种方法有什么区别,什么时候我应该使用 typedef 方法而不是其他方法?
<分区>
Possible Duplicate:
Purpose of struct, typedef struct, in C++
typedef struct vs struct definitions
我知道在 C 中有两种声明结构的方法
struct point{
int x, y;
};
和:
typedef struct{
int x, y;
} point;
但是这两种方法有什么区别,什么时候我应该使用 typedef 方法而不是其他方法?
最佳答案
区别:
point p;
与第二个一起使用。关于c - 带有 typedef 的结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12128922/