Login | Register

Replace a NULL pointer by a null object using object-oriented method


Replace a NULL pointer by a null object using object-oriented method

Li, Zhilin (1998) Replace a NULL pointer by a null object using object-oriented method. Other thesis, Concordia University.

Text (application/pdf)


Pointers are one of the most powerful and flexible features in C/C++, but they are also one of the most dangerous ones to use. Safe proramming practice requires a pointer to be initialized to NULL once declared. However a NULL pointer does not solve the problem completely. Accessing a NULL pointer may crash the application without offering any useful clues to the real problem. In Object-Oriented design, we can view a NULL pointer as a special kind of object with special behaviors and implement a null object to replace the NULL pointer. Accessing a null object will not crash the application, instead it can perform meaningful operations or display more helpful error messages. In this project, we implement a binary search tree, an AVL tree, a singly linked list using both the traditional NULL pointer method and the Object-Oriented null object method. We then compared the two methods in terms of safety, coding complexity, and time/space efficiency. The implementation language is C++

Divisions:Concordia University > Gina Cody School of Engineering and Computer Science > Computer Science and Software Engineering
Item Type:Thesis (Other)
Authors:Li, Zhilin
Pagination:xii, 218 leaves ; 29 cm.
Institution:Concordia University
Degree Name:Major reports (M.Comp.Sc.)
Program:Computer Science and Software Engineering
Thesis Supervisor(s):Grogono, Peter
ID Code:508
Deposited By: Concordia University Library
Deposited On:27 Aug 2009 17:12
Last Modified:18 Jan 2018 17:14
Related URLs:
All items in Spectrum are protected by copyright, with all rights reserved. The use of items is governed by Spectrum's terms of access.

Repository Staff Only: item control page

Downloads per month over past year

Back to top Back to top