Đang tải... (xem toàn văn)
This chapter presents the following content: Composition, aggregation, UML class diagram for composition and aggregation, car dealership program, inheritance overview, inheritance example - people in a department store, inheritance terminology, uml class diagrams for inheritance hierarchies,...and other contents.
CSC241: Object Oriented Programming Lecture No 30 Previous Lecture • Handler function – set_new_handler function • Standard library Exception Hierarchy • Example program – Queue class using array • Exception class can be define outside class Full { }; class Empty { }; class Queue{ }; Today’s Lecture • A linked list data storage class • Stream and classes • Input and Output stream • iostream class • ios class – Formatting Flags – Error-Status Bits – File operations Exercise program • • A link list data storage class It consist of a group of nodes which together represent a sequence data ptr data ptr data ptr data ptr ptr template struct Node { TYPE data; Node* next; }; template class linklist { private: Node* first; public: void additem(TYPE d); void display(); Go to program ... nodes which together represent a sequence data ptr data ptr data ptr data ptr ptr template struct Node { TYPE data; Node* next; }; template class linklist { private: Node*... class Queue{ }; Today’s Lecture • A linked list data storage class • Stream and classes • Input and Output stream • iostream class • ios class – Formatting Flags – Error-Status Bits – File operations...Previous Lecture • Handler function – set_new_handler function • Standard library Exception Hierarchy • Example