need help on my book coding here
help my coding is nearly finish it just i don't know to make the getCount() function to return the number of book objects that have been created..
and dont understand this line>>the count data member should be initialized to zero and must keep track of number of book objects..
my coding is like this
Code:
class Book
{
private:
string author,title;
const short bookType;
int count;
public:
Book( const string& author,const string& title, int bookType = 1):count(0);
~Book();
string getTitle();
string getAuthor();
Void setTitle(string title);
void setAuthor(string author);
int getCount(){return count;};
}
Book::Book( const string& author,const string& title, int bookType = 1);
{
setAuthor(author);
setTitle(title);
++count;
}
Book::~Book~(){
--count;
}
int Book::count = 0;
void Book::setTitle(string title)
{
title = title
}
string Book::getTitle()
{
return title;
}
void Book::setAuthor(string author)
{
author = author;
}
string Book::getAuthor()
{
return author;
}