首页 > 解决方案 > 在 C 编程中读取文件到链表

问题描述

我是 C 编程的新手。我来到了链表这一章,我根本无法从这个任务中继续前进。你能告诉我如何根据提供的说明创建一个链接列表吗?
我需要将文本文件中的文本加载到链接列表中。

感谢帮助。


文本文件的模式如下所示:

room number
number of beds (the number of beds determines how many guests will be accommodated in the room and how many guests will be loaded in the linked list)
the price
#
guest name
address
#
guest name
address
---
etc.

文本文件如下所示:

514
2
12,5
#
John Smith
Street 25, New York
#
Kate Smith
Streer 25, New York
---
134
1
20
#
Michael Collins
Street 12, Nebraska

标签: clinked-list

解决方案


推荐阅读