在双向链接列表中添加两个数据 [英] Adding two data in doubly link list

查看:79
本文介绍了在双向链接列表中添加两个数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何在我的图书馆管理系统project.ie int和char中同时添加2个数据,如book no和book name?



SHOUTING已删除 - OriginalGriff [/ edit]

How can I add 2 data like book no and book name in my library management system project.i.e int and char in doubly link list at same time?

[edit]SHOUTING removed - OriginalGriff[/edit]

推荐答案



实际上SA说得对,但这个问题含糊不清我将基于猜测工作回答:)

双向链接列表的每个节点应该有4个字段; 2用于向前和向后遍历,1用于存储int(书号)和1用于存储char(书名)。现在,无论何时填充节点,都必须填充两个字段。(结构的字段可以是不同的数据类型......如果这是您的关注点)

例如,如果用户填写书号,也必须填写书名。

如果您正面临其他问题请评论。



希望这个help!

Actually SA is right to say that the question is ambiguous but i'll answer based on guess work :)
Each node of your doubly link list should have 4 fields; 2 for forward and backward traversing and 1 for storing int(book number) and 1 for storing char(book name). Now whenever you are filling the node, you have to populate both fields.(Fields of a structure can be of different data types...if that was your concern)
For example if the user is filling the book number, make it mandatory to fill the book name as well.
Please comment if you are facing other issues.

hope this helps!


为Book详细信息创建一个类,并使用其中一个C ++集合类来创建列表。
Create a class for your Book details and use one of the C++ collection classes to create the list.


这篇关于在双向链接列表中添加两个数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆