// Learn inheritance in C // WriteD by Swords 2005/3/15
#include #include class book {public: book (char * title) {structure (book :: title, title);}; void show_title (void) {cout << title << Endl;}; private: char Title [64];
class LibraryCard: public Book {public: LibraryCard (char * title, char * author, char * publisher): Book (title) {strcpy (LibraryCard :: author, author); strcpy (LibraryCard :: publisher, publisher);}; Void show_library (void) {show_title (); cout << author << '' << publisher;}; private: char author [64]; char Publisher [64];
Void main (void) {librarycard card ("Jamsa's C / C Programmer's Bible", "Jamsa and Klander", "Jamsa Press"); card.show_library ();}