新手初学 实在不知道哪里出错了
#ifndef TABTENNO_H_
#define TABTENN0_H_
#include
using std::string;
class TableTennisplayer
{
private:
string firstname;
string lastname;
bool hasTable;
public:
TableTennisplayer(const string & fn = "none",
const string & ln = "none", bool ht = false);
void Name()const;
bool HasTable()const { return hasTable; };
void ResetTable(bool v) { hasTable = v; };
};
class Ratedplayer :public TableTennisplayer
{
private:
unsigned int rating;
public:
Ratedplayer(unsigned int r = 0, const string & fn = "none",
const string & ln = "none", bool ht = false);
Ratedplayer(unsigned int r, const TableTennisplayer & tp);
unsigned int Rating()const { return rating; }
void ResetRating(unsigned int r) { rating = r; }
};
#endif // !TABTENNO_H_
#include"tabtennO.h"
#include
TableTennisplayer::TableTennisplayer(const string & fn,
const string & ln, bool ht) :firstname(fn),
lastname(ln), hasTable(ht) {}
void TableTennisplayer::Name()const
{
std::cout << lastname << ", " << firstname;
}
Ratedplayer::Ratedplayer(unsigned int r, const string & fn,
const string & ln, bool ht):TableTennisplayer(fn, ln, ht)
{
rating = r;
}
Ratedplayer::Ratedplayer(unsigned int r,const TableTennisplayer & tp)
:TableTennisplayer(tp), rating(r)
{
}