Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/130.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 文件中的链接列表,c+;中每个输入的格式不同+;_C++_Linked List - Fatal编程技术网

C++ 文件中的链接列表,c+;中每个输入的格式不同+;

C++ 文件中的链接列表,c+;中每个输入的格式不同+;,c++,linked-list,C++,Linked List,我正在寻找一些关于如何将文件写入链接列表的信息 假设我有一个file.txt,如下所示: Jen Red 12 25 14 18 58 19 0 0 Marie Blue 25 56 0 0 Nancy Purple 556 621 111 2 1 141 114 2 0 0 我想把这个写进一个链表 我们首先开始写名字和颜色。之后,我们需要输入一些数据,但每个人的输入数量不同。我们通过0 0终止了链接列表,并为另一个人重

我正在寻找一些关于如何将文件写入链接列表的信息

假设我有一个file.txt,如下所示:

Jen    Red
12     25
14     18
58     19
0 0

Marie  Blue
25     56
0 0

Nancy  Purple
556    621
111    2
1      141
114    2
0 0
我想把这个写进一个链表

我们首先开始写名字和颜色。之后,我们需要输入一些数据,但每个人的输入数量不同。我们通过
0 0
终止了链接列表,并为另一个人重复了该过程

在哪里可以找到更多关于这方面的信息

我想把这个写进一个链表

怎么做?每个人都是自己的节点,还是每个人都是自己的链接列表

你到底想用这些信息做什么?您计划如何处理信息可能会影响哪种数据结构最适合您的应用程序

我们通过
0 0
终止了链接列表,并为另一个人重复了该过程

那只是一个
while
循环

在哪里可以找到更多关于这方面的信息


使用
std::cin
while
循环。