嗯,我的项目要求我在链接列表中创建一个链接列表。我这样定义可以吗?
struct users {
int user_ID;
struct playlist{
int album;
int track_num;
struct playlist *next;
}
struct users *next;
};
最佳答案
为什么不将结构分开?
struct Playlist{
int album;
int track_num;
struct Playlist *next;
}
struct users {
int user_ID;
struct Playlist playlist
struct users *next;
};
它更容易阅读,更容易理解。
关于c - 这就是我在链表中创建链表的方式吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9944113/