【C++】图书管理系统(完整版)

本文章已经生成可运行项目,

往期源码回顾:
【C++实现图书管理系统(Qt C++ GUI界面版)
【Python】实现爬虫,爬取天气情况并进行分析(完整版)

上述源码大家有需要可自取,大家有需要可以来找我要源码。


【亲测宝藏】发现一个让 AI 学习秒变轻松的神站!不用啃高数、不用怕编程,高中生都能看懂的人工智能教程来啦!

这里没有枯燥公式,只有幽默段子 + 接地气讲解,连人脸识别、自动驾驶这些硬核内容都被拆解得像讲笑话一样好懂~作者十年积累的实战代码直接送,从基础原理到股票预测、金融分析全涵盖,学完就能拿项目练手,找份 AI 相关工作超稳!

👉点击跳转,和 thousands of 小伙伴一起用快乐学习法征服 AI,说不定下一个开发出爆款 AI 程序的就是你!



图书管理系统功能概览:

  1. 登录,注册
  2. 学生,老师借书,查看自己当前借书情况,还书。
  3. 管理员增加书,查看当前借阅情况,查看当前所有借阅人,图书信息。

代码概览:

各个模块主要负责功能
 COperationManagement.h  负责登录,注册,管理员,将图书,初始化操作,将借阅信息等从文件中读取出来,放入容器中,便于操作,不用一直对文件进行I/O.
 CBook.h  用于对书抽象,并实现了>>的重载,便于文件读入,读出
 CUser.h  工具人,作为老师,学生的父类
 CStudent.h  对学生进行的抽象
 CTeacher.h 对老师进行的抽象
 CAdministrator.h 对管理的抽象
 CManagementBooks.h  用户所有的相关操作的中间执行者,有设计模式中代理的思想
 源.cpp  界面的的实现与系统入口

全部代码与讲解:
1.源.cpp
作为系统的入口与交互界面核心,承担着启动系统、初始化各模块及呈现用户交互界面的重任。通过精心设计的菜单式交互界面,为用户提供直观便捷的操作入口,引导用户完成各项功能操作。同时,它作为系统流程的总控中心,协调各模块间的数据传递与功能调用,确保整个系统的流畅运行与用户体验的一致性,是用户与系统功能实现之间的重要桥梁。

#include<iostream>
#include"CBook.h"
#include"CStudent.h"
#include"CManagementBooks.h"
#include"CTeacher.h"
#include<fstream>
#include"CAdministrator.h"
#include"COperationManagement.h"
using namespace std;
int main()
{
	CManagementBooks mb;
	CUser* user = nullptr;
	COperationManagement om;
	om.init(mb);
	cout << "***** 欢迎来到图书馆 *****" << endl;
	cout << "注意事项" << endl;
	cout << "1.学生最多共可借三本书,老师最多共可借五本"<<endl<<endl;
	cout << "请选择您的登录方式 1:老师 2:学生 3:管理员" << endl;
	int t;
	cin >> t;
	if (t == 1)
	{
		user = new CTeacher;
	}
	else if(t == 2)
	{
		user = new CStudent;
	}
	else if(t == 3)
	{
		CAdministrator admin;
		om.adminLogin(admin);
		admin.showInfo();
		om.adminOperation(admin, mb);
		return 0;
	}
	cout << "您是否已有账号?(y/n):" << endl;
	string c;
	cin >> c;
	if (c == "y")
	{
		cout << "请登录:" << endl;
		om.login(user,t);
		user->showInfo();
	}
	else
	{
		cout << "来注册一个吧!" << endl;
		om.Register(user,t);
	}
	om.userOperation(user, mb);
	delete user;
	return 0;
}

实现效果:
在这里插入图片描述
2.COperationManagement.cpp
作为系统的数据中枢与基础功能核心,该头文件整合了系统运行所需的关键操作。登录与注册模块通过严格的身份验证机制,确保用户数据安全;管理员功能赋予特定权限用户对系统全局的管理能力。此外,其核心亮点在于数据预处理环节,将图书信息、借阅记录等关键数据从文件中高效读取并存储至容器,构建起内存级的数据缓存区。这一设计不仅显著提升了数据访问速度,还大幅减少了频繁文件 I/O 操作带来的性能损耗,为系统的流畅运行提供坚实保障。

#include "COperationManagement.h"
void COperationManagement::login(CUser* user, int t)
{
	ifstream readFile;
	ifstream readFile1;
	if (t == 1)
	{
		readFile.open("teacherLogin.txt");
		readFile1.open("teacher.txt");
	}
	else
	{
		readFile1.open("student.txt");
		readFile.open("studentLogin.txt");
	}
	if (!readFile.is_open())
	{
		cout << "登录数据读取错误" << endl;
	}
	if (!readFile1.is_open())
	{
		cout << "用户数据读取错误" << endl;
	}
	cout << "请输入您的学工号:" << endl;
	string account, password;
	cin >> account;
	int flag = 0;
	while (!readFile.eof())
	{
		string act;
		readFile >> act;
		if (act == account)
		{
			cout << "请输入密码:" << endl;
			cin >> password;
			string pwd;
			readFile >> pwd;
			if (pwd == password)
			{
				cout << "登录成功" << endl;
				flag = 1;
				
				while (!readFile1.eof())
				{
					
					readFile1 >> user;
			
					if(user->getId() == act)
					{
						break;
					}
				}
				break;
			}
			else
			{
				cout << "密码错误,请重新登录" << endl;
				login(user, t);
			}
		}

	}
	if (!flag)
	{
		cout << "学工号错误,请重输入" << endl;
		login(user, t);
	}
	readFile.close();
	readFile1.close();
}

void COperationManagement::Register(CUser* user, int t)
{
	ofstream writeFile;
	ofstream writeFile1;
	if (t == 1)
	{
		writeFile1.open("teacher.txt", ios::app);
		writeFile.open("teacherLogin.txt",ios::app);
	}
	else
	{
		writeFile1.open("student.txt", ios::app);
		writeFile.open("studentLogin.txt",ios::app);
	}
	string pwd, act;
	cout << "请输入您的学工号作为注册账号:" << endl;
	cin >> act;
	cout << "请输入您的注册密码:" << endl;
	cin >> pwd;
	writeFile << endl << act << " " << pwd;
	cout << "请完善您的相应信息:" << endl;
	string  name, department, gender;
	cout << "您的姓名:" << endl;
	cin >> name;
	cout << "您的性别:" << endl;
	cin >> gender;
	cout << "您所在的院系:" << endl;
	cin >> department;
	writeFile1 <<endl << act << " " << name << " " << gender << " " << department;//这里不能用user,因为在登录时才用,并且并没有初始化
	writeFile.close();
	writeFile1.close();
	cout << "注册成功! 赶紧登录进入图书管吧!" << endl;
	login(user, t);
}

void COperationManagement::userOperation(CUser* user, CManagementBooks mb)
{
	while (1)
	{
		cout << "请选择您的操作 1.借书 2.查看自己当前借书情况 3.还书 4.退出" << endl;
		int t;
		cin >> t;
		if (t == 1)
		{
			cout << "当前图书馆情况如下:" << endl;
			mb.showCurrentAllBook();
			cout << "是否有您想要借阅的图书(y/n)" << endl;
			string s;
			cin >> s;
			if (s == "y")
			{
				user->borrowBookFromLibrary(mb);
			}
		}
		else if (t == 2)
		{
			mb.checkBorrowedBook(user->getId());
		}
		else if (t == 3)
		{
			user->returnBook(mb);
		}
		else if (t == 4)
		{
			cout << "退出成功" << endl;
			break;
		}
		else
		{
			cout << "暂无此操作,请按提示操作" << endl;
		}
	}
}

void COperationManagement::adminLogin(CAdministrator& admin)
{
	ifstream readFile("adminLogin.txt");
	ifstream readFile1("admin.txt");
	cout << "请输入您的工号:" << endl;
	string account, password;
	cin >> account;
	int flag = 0;
	while (!readFile.eof())
	{
		string act;
		readFile >> act;
		if (act == account)
		{
			cout << "请输入密码:" << endl;
			cin >> password;
			string pwd;
			readFile >> pwd;
			if (pwd == password)
			{
				cout << "登录成功,欢迎您" << endl;
				flag = 1;

				while (!readFile1.eof())
				{
					
					readFile1 >> admin;
					if(admin.getId() == act)
					{
						break;
					}
				}
				break;
			}
			else
			{
				cout << "密码错误,请重新登录" << endl;
				adminLogin(admin);
			}
		}

	}
	if (!flag)
	{
		cout << "学工号错误,请重输入" << endl;
		adminLogin(admin);
	}
	readFile.close();
	readFile1.close();

}

void COperationManagement::init(CManagementBooks& mb)
{
	mb.initBooks();
	mb.initOutBook();
}

void COperationManagement::adminOperation(CAdministrator admin, CManagementBooks mb)
{
	while (1)
	{
		cout << "请选择您的操作 1.增加书 2.查看当前借阅情况 3.查看当前所有图书信息情况 4.查看借阅人详细信息 5.退出" << endl;
		int t;
		cin >> t;
		if (t == 1)
		{
			admin.addBook(mb);
		}
		else if (t == 2)
		{
			mb.checekOutBook();
		}
		else if (t == 3)
		{
			mb.showAllBooksInfo();
		}
		else if (t == 4)
		{
			string id;
			cout << "请输入您要查看借阅人的学工号:" << endl;
			cin >> id;
			mb.viewBorrowerDetails(id);
		}
		else if (t == 5)
		{
			cout << "退出成功" << endl;
			break;
		}
		else
		{
			cout << "暂无此操作,请按提示操作" << endl;
		}
	}
}

登录效果:
在这里插入图片描述其余功能大家可以自行测试。

CUser.cpp
作为用户体系的抽象基类,定义了所有用户角色(教师、学生)共有的基础属性与行为接口,如用户 ID、姓名等基础信息及通用操作方法。这种设计遵循面向对象编程的继承思想,为教师类和学生类提供统一的设计规范,既避免了代码冗余,又便于后续系统扩展新的用户角色,增强了系统的可维护性与扩展性。

#include "CUser.h"
#include<iostream>
#include<fstream>
#include"CManagementBooks.h"
using namespace std;




CUser::CUser()
{
    m_name = "陈1";
}

void CUser::setId(string id)
{
    m_id = id;
}

void CUser::setName(string name)
{
    m_name = name;
}

void CUser::setGender(string gender)
{
    m_gender = gender;
}



void CUser::setDepartment(string department)
{
    m_department = department;
}




CUser::~CUser()
{
}

void CUser::returnBook(CManagementBooks& mb)
{
    int all = mb.checkBorrowedBook(m_id);
    if (all == 0)
    {
        cout << "您暂未借书,无需归还" << endl;
    }
    else
    {
        cout << "请输入您要归还的书名:" << endl;
        string bookName;
        cin >> bookName;
        if (mb.checkTrueBorrow(m_id, bookName))
        {
            mb.Return(m_id, bookName);
            cout << "还书成功" << endl;
        }
        else
        {
            cout << "您并未借阅此书" << endl;
        }
    }
}

string CUser::getId()
{
    return m_id;
}

string CUser::getName()
{
    return m_name;
}

string CUser::getGender()
{
    return m_gender;
}


string CUser::getDepartment()
{
    return m_department;
}

std::ostream& operator<<(std::ostream& os, const CUser* user)
{
    os<< endl << user->m_id << " " << user->m_name << " " << user->m_gender << " " << user->m_department;
    return os;
}

std::istream& operator>>(std::istream& is, CUser* user)
{
   is >> user->m_id >> user->m_name >> user->m_gender >> user->m_department;
   return is;
}

CTeacher.cpp

#include "CTeacher.h"
#include<fstream>

CTeacher::CTeacher()
{
    m_name = "刘X";
}

void CTeacher::borrowBookFromLibrary(CManagementBooks& mb)
{
   
        int all = mb.checkBorrowedBook(m_id);
        if (all < 5)
        {
            string name;
            cout << "请输入您要借的书名:" << endl;
            cin >> name;
            if (mb.borrow(name))
            {
                ofstream writeFile("borrowedBook.txt", ios::app);
                mb.setMapValue(m_id, name);
                writeFile << endl << m_id << " " << name;
                writeFile.close();
            }
        }
        else
        {
            cout << "您已经超过了最大可借阅数" << endl;
        }
}
void CTeacher::showInfo()
{
    cout << "姓名:" << m_name<<" " << "学号:" << m_id<<" " << "性别:" << m_gender<<" " << "院系:" << m_department << endl;
}



CStudent.cpp

#include "CStudent.h"
#include<fstream>
using  namespace std;


CStudent::CStudent()
{
    m_class = "软件";
}

void CStudent::showInfo()
{
    cout << "姓名:" << m_name << " " << "学号:" << m_id << " " << "性别:" << m_gender << " " << "院系:" << m_department << " "<<"班级:"<<m_class<<endl;
}

void CStudent::borrowBookFromLibrary(CManagementBooks& mb)
{
    int all = mb.checkBorrowedBook(m_id);
    if (all < 3)
    {
        string name;
        cout << "请输入您要借的书名:" << endl;
        cin >> name;
        if (mb.borrow(name))
        {
            ofstream writeFile("borrowedBook.txt", ios::app);
            mb.setMapValue(m_id, name);
            writeFile << endl << m_id << " " << name;
            writeFile.close();
        }
    }
    else
    {
        cout << "您已经超过了最大可借阅数" << endl;
    }
    
}



void CStudent::setClass(string Class)
{
    m_class = Class;
}



string CStudent::getClass()
{
    return m_class;
}



CManagementBooks.cpp
扮演着系统功能调度与协调的关键角色,借鉴设计模式中的代理思想,将用户的各类操作请求进行统一接收与处理。它如同一个智能中转站,根据用户请求类型,调用相应模块的功能实现,有效隔离了用户操作与底层功能实现的复杂逻辑,提升了系统的模块化程度与可维护性,同时也便于后续功能的扩展与升级

#include "CManagementBooks.h"
using namespace std;

void CManagementBooks::showCurrentAllBook()
{
	for (int i = 0; i < m_allBookNum; i++)
	{
		cout << "书名:" << m_books[i].getName() <<" " << "剩余数量" << m_books[i].getNum() << endl;
	}
}

CManagementBooks::CManagementBooks()
{
	m_allBookNum = 0;
}

void CManagementBooks::addBook(CBook book)
{
	int flag = 0;
	for (int i = 0; i < m_allBookNum; i++)
	{
		if (m_books[i].getName() == book.getName())
		{
			flag = 1;
			m_books[i].setNum(m_books[i].getNum() + book.getNum());
			ofstream writeFile("library.txt", ios::out);
			for (int i = 0; i < m_allBookNum; i++)
			{
				writeFile << m_books[i];
			}
			writeFile.close();
			break;
		}
	}
	if (!flag)
	{
		ofstream writeFile("library.txt", ios::app);
		m_books.push_back(book);
		m_allBookNum++;
		writeFile << book;
		writeFile.close();
	}
}



int CManagementBooks::getAllBookNum()
{
	return m_allBookNum;
}

void CManagementBooks::showAllBooksInfo()
{
	for (int i = 0; i < m_allBookNum; i++)
	{
		m_books[i].showInfo();
	}
}

bool CManagementBooks::borrow(string name)
{

	for (int i =0; i <m_allBookNum; i++)
	{
		if (m_books[i].getName() == name)
		{
			if (m_books[i].getNum() >= 1)
			{
				m_books[i].setNum(m_books[i].getNum() - 1);
				cout << "借书成功" << endl;
				ofstream writeFile("library.txt");
				for (int i = 0; i < m_allBookNum; i++)
				{
					writeFile << m_books[i];
				}
				writeFile.close();
				return true;
			}
			else
			{
				cout << "此书数量不足" << endl;
				return false;
			}
		}

	}
	cout << "很抱歉,暂无此书" << endl;
	return false;
}

void CManagementBooks::Return(string id,string bookName)
{
	CBook book;
	book.setName(bookName);
	addBook(book);
	ofstream writeFile("borrowedBook.txt",ios::out);
	for (auto iter =m_outBookMap.begin(); iter != m_outBookMap.end(); ++iter)
	{
		if (iter->first == id && iter->second == bookName)
		{
			m_outBookMap.erase(iter);
			break;
		}
	}
	for (auto map : m_outBookMap)
	{
		writeFile << endl << map.first << " " << map.second;
	}
	writeFile.close();
}

void CManagementBooks::initOutBook()
{
	ifstream readFile("borrowedBook.txt");
	if (!readFile.is_open())
	{
		cout << "查看全体借书情况数据读取出错" << endl;
	}
	else
	{
		while (!readFile.eof())
		{
			string studentId, bookName;
			readFile >> studentId >> bookName;
			m_outBookMap.insert(pair<string, string>(studentId, bookName));
		}
	}
	readFile.close();

}

void CManagementBooks::checekOutBook()
{
	for (auto map : m_outBookMap)
	{
		cout << "借阅人学工号:" << map.first<<" " << "借阅书名:" << map.second << endl;
	}
}

void CManagementBooks::initBooks()
{
	ifstream readFile;
	readFile.open("library.txt");
	if (!readFile.is_open())
	{
		cout << "图书数据读取错误" << endl;
		readFile.close();
		return;
	}
	while (!readFile.eof())
	{
		
		CBook book;
		readFile >> book;
		m_allBookNum++;
		m_books.push_back(book);
	}
	readFile.close();
}

int CManagementBooks::checkBorrowedBook(string userId)
{
	
	int flag = 0;
	for (auto map : m_outBookMap)
	{
		if (userId == map.first)
		{
			if (!flag)
			{
				cout << "您已经借的全部图书如下:" << endl;
				flag++;
			}
			else
			{
				flag++;
			}
			cout << map.second << " ";
		}
	}
	if (!flag)
	{
		cout << "您目前没有借书" << endl;
	}
	cout << "共:" << flag << "本";
	cout << endl;
	return flag;
}

void CManagementBooks::viewBorrowerDetails(string id)
{
	ifstream readFile("teacher.txt");
	ifstream readFile1("student.txt");
	int flag = 0;
	if (!readFile1.is_open()|| !readFile.is_open())
	{
		cout << "用户数据读取错误" << endl;
	}
	while (!readFile1.eof())
	{
		string act1, name, department, gender;
		readFile1 >> act1 >> name >> gender >> department;
		if (id == act1)
		{
			cout<<"用户类别:"<<"学生"<<" " << "用户姓名:" << name << " " << "用户性别:" << gender << " " << "用户所在部门:" << department << endl;
			flag = 1;
		}
	
	}
	if (!flag)
	{
		while (!readFile.eof())
		{
			string act1, name, department, gender;
			readFile >> act1 >> name >> gender >> department;
			if (id == act1)
			{
				flag = 1;
				cout << "用户类别:"<<"老师"<<" " << "用户姓名:" << name << " " << "用户性别:" << gender << " " << "用户所在部门:" << department << endl;
			}

		}
	}
	if (!flag)
	{
		cout << "无此用户!" << endl;
	}
	readFile.close();
	readFile1.close();
}

bool CManagementBooks::checkTrueBorrow(string id, string bookName)
{
	
	for (auto map : m_outBookMap)
	{
		if (map.first == id && map.second == bookName)
		{
			return true;
		}
	}
	return false;
}

void CManagementBooks::setMapValue(string userId,string bookName)
{
	m_outBookMap.insert(pair<string, string>(userId, bookName));
}



CBook.cpp
聚焦于图书实体的抽象与数据交互优化。通过构建图书类,对图书的核心属性如书名、作者、ISBN、库存等进行精准建模,形成标准化的数据结构。同时,重载输入输出流运算符(>> 和 <<),使图书对象在文件读写操作中实现无缝对接,极大地简化了数据持久化与读取流程,提升了系统数据处理的便捷性与规范性。

#include "CBook.h"
#include <iostream>
#include<fstream>
using namespace std;


CBook::CBook()
{
	string b = "";
	string randStr = "0123456789X";
	for (int i = 0; i <= 12; i++)
	{
		if (i == 1 || i == 5 || i == 11)
		{
			b += '-';
		}
		else
		{
			if (i == 12)
			{
				b += randStr[rand() % 11];
			}
			else
			{
				b += randStr[rand() % 10];
			}
		}
	}
	m_num = 1;
	m_name = "等待戈多";
	m_author = "李XX";
	m_isbn = b;
	m_page = rand();
	m_pressInfo = "XX出版社";
	m_price = rand();
}

void CBook::setNum(int num)
{
	m_num = num;
}

int CBook::getNum()
{
	return m_num;
}


void CBook::setName(string name)
{
	m_name = name;
}

string CBook::getName()
{
	return m_name;
}

void CBook::setIsbn(string isbn)
{
	m_isbn = isbn;
}

string CBook::getIsbn()
{
	return m_isbn;
}

void CBook::setPressInfo(string perssInfo)
{ 
	m_pressInfo = perssInfo;
}

string CBook::getPressInfo()
{
	return m_pressInfo;
}

void CBook::setPrice(double price)
{
	m_price = price;
}

double CBook::getPrice()
{
	return m_price;
}

void CBook::setPage(int page)
{
	m_page = page;

}

int CBook::getPage()
{
	return m_page;
}

void CBook::setAuthor(string author)
{
	m_author = author;
}

string CBook::getAuthor()
{
	return m_author;
}


void CBook::checkIsnb()
{
	int sum = 0;
	for (int i = 0, j = 1; i < m_isbn.size(); i++) {
		if (m_isbn[i] != '-' && i != 12) {
			sum += (m_isbn[i] - '0') * j;
			j++;
		}

	}
	sum %= 11;
	char c = 'X';
	if (sum < 10) c = sum + '0';
	if (m_isbn[12] == c) puts("This book isbn are Right!");
	else puts("This book isbn are wrong!");
}



bool CBook::isBorrowed()
{
	if (m_num >= 1)
	{
		m_num--;
		return true;
	}
	return false;
}

void CBook::showInfo()
{
	cout<<"作者:" << m_author << " "<<"isbn号码:" << m_isbn << " " <<"书本名称:"<< m_name << " "
		<<"总页数:" << m_page << " " <<"出版社:" << m_pressInfo << " " <<"价格:" << m_price
		<< " " <<"剩余本数:"<<m_num<< endl;
}

std::ostream& operator <<(std::ostream& os, const CBook& book)
{
	os << endl <<book.m_name << " " <<book.m_isbn << " " << book.m_pressInfo << " " <<book.m_price << " " << book.m_page << " " << book.m_author << " " << book.m_num;
	return os;
}

std::istream& operator>>(std::istream& is, CBook& book)
{
	is >> book.m_name >> book.m_isbn >> book.m_pressInfo >> book.m_price >>book.m_page >> book.m_author >> book.m_num;
	return is;
}





本文章已经生成可运行项目
/*****************************************************************************************/#include #include #include #include //输入/输出文件流类using namespace std;const int Maxr=100;//最多的读者const int Maxb=100;//最多的图书const int Maxbor=5;//每位读者最多借五本书//读者类,实现对读者的信息的描述class Reader { private: int tag; //删除标记 1:已删 0:未删 int no; //读者编号 char name[10]; //读者姓名 int borbook[Maxbor];//所借图书 public: Reader() {} char *getname() {return name;} //获取姓名 int gettag() {return tag;} //获取删除标记 int getno() {return no;} //获取读者编号 void setname(char na[]) //设置姓名 { strcpy(name,na); } void delbook(){ tag=1; }//设置删除标记 1:已删 0:未删 void addreader(int n,char *na)//增加读者 { tag=0; no=n; strcpy(name,na); for(int i=0;i<Maxbor;i++) borbook[i]=0; } void borrowbook(int bookid)//借书操作 { for(int i=0;i<Maxbor;i++) { if (borbook[i]==0) { borbook[i]=bookid; return; } } } int retbook(int bookid)//还书操作 { for(int i=0;i<Maxbor;i++) { if(borbook[i]==bookid) { borbook[i]=0; return 1; } } return 0; } void disp()//读出读者信息 { cout << setw(5) << no <<setw(10) << name<<"借书编号:["; for(int i=0;i<Maxbor;i++) if(borbook[i]!=0) cout << borbook[i] << "|"; cout << "]"<<endl; }};//读者类库,实现建立读者的个人资料 class RDatabase{ private: int top; //读者记录指针 Reader read[Maxr];//读者记录public: RDatabase() //构造函数,将reader.txt读到read[]中 { Reader s; top=-1; fstream file("reader.txt",ios::in);//打开一个输入文件 while (1) { file.read((char *)&s,sizeof(s)); if (!file)break; top++; read[top]=s; } file.close(); //关闭 reader.txt } void clear()//删除所有读者信息 { top=-1; } int addreader(int n,char *na)//添加读者时先查找是否存在 { Reader *p=query(n); if (p==NULL) { top++; read[top].addreader(n,na); return 1; } return 0; } Reader *query(int readerid)//按编号查找 { for (int i=0;i<=top;i++) if (read[i].getno()==readerid && read[i].gettag()==0) { return &read[i]; } return NULL; } void disp() //输出所有读者信息 { for (int i=0;i<=top;i++) read[i].disp(); } void readerdata();//读者库维护 ~RDatabase() //析构函数,将read[]写到reader.txt文件中 { fstream file("reader.
评论 139
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

软件编程在线接单(需要可私)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值