Declares linkedlist these instances are called class

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: an instance of the class LinkedList. declares LinkedList These instances are called (class) objects. These (class) What does the compiler do with this? It sets aside memory for one LinkedList data It LinkedList data structure – and names it list. and list Applied Programming Applied Programming How much space? Enough for the data component – both the public Enough both and private data. and There is only one copy of the function code, There regardless of how many instances of the class. regardless So our LinkedList iinstance requires 4 bytes So LinkedList nstance for Head – and each instance has its own Head. Head and Head Applied Programming W hen such an instance of LinkedList iis When LinkedList s created, its version of Head iis not initialised. So Head s we need to call the function we LinkedList::Initialise(); It looks very much like the way we referred to It stream functions like stream cin.eof() and ofs.close(). and ofs.close To refer to a specific instance we use the To...
View Full Document

This document was uploaded on 04/07/2014.

Ask a homework question - tutors are online