部分代码如下
#ifndef LIBRARY_H
#define LIBRARY_H
#include<string>
using namespace std;
class Library
{
public:
Library(int,int,Catalogue,Borrower*);
~Library();
void displayMessage()const;
void displayBorrower()const;
void setmulu();
void setborr();
private:
int totalBook;
int borrower;
//就是下面两行报错,把Library类里有关这两个的注释掉就可以运行
Catalogue mulu;
Borrower *totalBorrower;
};
class Catalogue
{
public:
Catalogue(BookRecord* = NULL,int=0);
~Catalogue();
private:
BookRecord *totalBookRecord;
int total;
};
void enterborrower();
void enterbookrecord();
#endif
.cpp部分代码
#include<string>
#include<iostream>
#include<cstdlib>
#include"Library.h"
using namespace std;
Library::Library(int a,int b,Catalogue c,Borrower *d)
:mulu(c)
{
totalBook = a;
borrower = b;
totalBorrower = d;
}
大神帮帮忙