{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

As in it shows that streams are just instances of a

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: instance name as a prefix, followed by . as in It shows that streams are just instances of a It stream class – stream objects. list.Initialise(); (They also look the same as references to (They struct members.) struct Does this form seem familiar? Applied Programming So we can call list.Initialise(); Applied Programming Its name is the name of the class. And it has no type (not even void). And void But C++ helps us more than that. W e can set up the values of any private data We automatically when the variable is declared. automatically So, for our LinkedList class we have the So, LinkedList class prototype prototype LinkedList(); A special public function is created, called special a constructor. constructor in our interface. Applied Programming Its implementation would be Applied Programming For example, LinkedList::LinkedList() { Head = 0; } void A() { LinkedList Alist; ... ... } How do we call it? How We don't. We would generate a call to the constructor. C++ automatically calls it when we declare an C...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online