情况紧急,关于C++Book类(查找功能、链表问题)

来源:百度知道 编辑:UC知道 时间:2024/06/14 19:34:14
关于C++Book类的链表问题:关键问题在于我不知道链表如何创建,整一天了,代码如下:
可能比较繁琐,希望有空的朋友帮忙看看,只要教我如何成功实现查找(Book *bnamesearch(string nam);)就行了!要速度~~ 谢谢!
#include <iostream>
#include <string>
using namespace std;

class Book
{
private:
string bookname;
string writer;
int writernumber;
string pulisher;
string ISBNnumber;
double price;
int booknumber;

public:
Book *next;
void menu(int n);//管理菜单
void setinfo();//输出信息
void showinfo();//输出信息
string get_bookname(){return bookname;}

};
void Book::setinfo()//输入信息
{
cout<<"输入书名:";

cin>>bookname;
cout<<"作者数:";
cin>>writernumber;
cout<<"输入作者姓名:";
cin>>writer;
cout<<"输入出版社:";
cin>>pulisher;
cout<<"输入ISBN号:";
cin>>ISBNnumber;
cout<

#include <iostream>
#include <string>
using namespace std;

class Book
{
private:
string bookname;
string writer;
int writernumber;
string pulisher;
string ISBNnumber;
double price;
int booknumber;

public:
Book *next;
void menu(int n);//管理菜单
void setinfo();//输出信息
void showinfo();//输出信息
string get_bookname(){return bookname;}

};
void Book::setinfo()//输入信息
{
cout<<"输入书名:";

cin>>bookname;
cout<<"作者数:";
cin>>writernumber;
cout<<"输入作者姓名:";
cin>>writer;
cout<<"输入出版社:";
cin>>pulisher;
cout<<"输入ISBN号:";
cin>>ISBNnumber;
cout<<"价格:";
cin>>price;
}
void Book::showinfo()//输出信息
{
cout<<"书名:\t"