UniversityDatabse.h
#include<string>
#include<stdexcept>
#include<iostream>
#include<map>
#include "UniversityPerson.h"
class UniversityPerson ;
using namespace std ;
#ifndef UNIVERSITYDATABASE_H
#define UNIVERSITYDATABASE_H
class UniversityDatabase
{
public:
UniversityDatabase() ;
~UniversityDatabase() ;
void print() ;
void Create(UniversityPerson *p ) ;
void Delete1( string name ) ;
void Delete2( string id ) ;
UniversityPerson *Lookup1(string id ) ;
UniversityPerson *Lookup2(string name ) ;
private:
map<name , (UniversityPerson *)>NAME ;
map<id, (UniversityPerson *)> ID ;
} ;
#endif
UniversityPerson.h
#include<string>
#include<stdexcept>
#include<iostream>
#ifndef UNIVERSITYPERSON_H
#define UNIVERSITYPERSON_H
using namespace std ;
class UniversityPerson
{
private:
string name ;
string id ;
string emailadress ;
string phonenumber ;
static bool flag ;
public:
UniversityPerson(string thename , string theid , string theemailadress ,string thephonenumber) ;
~ UniversityPerson() ;
virtual string toString() ;
string getname() ;
string getid() ;
string getemailadress() ;
string getphonenumber() ;
void setemailadress(string email ) ;
void setphonenumber( string phone) ;
void setflag( string indicateflag ) ;
bool getflag() ;
};
#endif
compile it with
g++ -c UniversityDatabase.h and get
UniversityDatabase.h:33: error: ânameâ was not declared in this scope
UniversityDatabase.h:33: error: template argument 1 is invalid
UniversityDatabase.h:33: error: template argument 2 is invalid
UniversityDatabase.h:33: error: template argument 3 is invalid
UniversityDatabase.h:33: error: template argument 4 is invalid
UniversityDatabase.h:34: error: âidâ was not declared in this scope
UniversityDatabase.h:34: error: template argument 1 is invalid
UniversityDatabase.h:34: error: template argument 2 is invalid
UniversityDatabase.h:34: error: template argument 3 is invalid
UniversityDatabase.h:34: error: template argument 4 is invalid
what do I have to fix?