Tải bản đầy đủ (.pdf) (5 trang)

Lecture Object oriented programming - Lecture No 30

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (27.32 KB, 5 trang )

CSC241: Object Oriented Programming

Lecture No 30

1


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{
. . . };
2




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
3


Exercise program 2




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
templateTYPE>
struct Node
{
TYPE data;
Node* next;
};


template<class TYPE>
class linklist {
private:
Node<TYPE>* first;
public:
void additem(TYPE
d);
void display();

Go to
program

4


5



×