Year constructor bookbookstring titlein int yearin

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e •  Ini/alizing the derived object; class members using the constructor ini/aliza/on •  Finally the allocated space list. for the full object is reclaimed; •  Execu/ng the body of the derived class constructor. Derived Class Constructors //default constructor Book::Book():year(0){} //copy constructor Book::Book(const Book& other): title (other.title),year (other.year){} //constructor Book::Book(string title_in, int year_in): title(title_in),year (year_in){} //destructor Book::~Book(){} //default constructor AudioBook::AudioBook():Book (),length(0.0){} //copy constructor AudioBook::AudioBook(const AudioBook& other):Book (other),length (other.length){} //constructor AudioBook::AudioBook(string title_in, int year_in, double length_in):Book (title_in,year_in),length (length_in){} //destructor AudioBook::~AudioBook(){} Derived Class Assignment Operator Book& Book::operator= (const Book& rhs) { //check for...
View Full Document

This document was uploaded on 03/06/2014 for the course CS 3710 at Memorial University.

Ask a homework question - tutors are online