我想了解一段代码中的struct用法。这让我非常困惑。看起来像typedef在同一个结构体上使用两次。请任何人都可以帮我理解为什么这段代码有两次typedef。有什么办法可以简化这段代码。 非常感谢您的时间。typedef在相同的结构上使用两次
typedef struct {
city_t* cities;
int count;
cost_t cost;
} tour_struct;
typedef tour_struct* tour_t;
typedef struct {
tour_t* list;
int list_sz;
int list_alloc;
} stack_struct;
typedef stack_struct* my_stack_t;
'tour_struct'是一个结构。 'tour_t'是一个'tour_struct *',也就是'tour_t'是一个指向结构类型的指针,定义为tour_struct – nhgrif 2014-11-23 16:19:34