The global functions are public members the public

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: bal functions are public members. The public CustPtr Head; We have 3 functions to reference this structure. void void void void bool Initialise(CustPtr& Head); Initialise(CustPtr Add(char name, int psize, CustPtr& Head); Add(char name, int CustPtr Remove(char name, int& psize, CustPtr& Head); name, int psize CustPtr If we only had one list we could hide the Head If Head within the file scope of the functions. Applied Programming This is the interface component. class LinkedList class LinkedList { public: void Initialise(); void Add(char,int); void Add(char,int bool Remove(char,int&); private: CustPtr Head; }; Applied Programming The filescope Head has become a private The filescope has private member of the class. The global functions are public members. The public void LinkedList::Initialise() void LinkedList::Initialise { Head = 0; } This is the interface component. This is the same as before with the replacement This of the argument by the LinkedList:: prefix to LinkedList prefix the function name. the It app...
View Full Document

This document was uploaded on 04/07/2014.

Ask a homework question - tutors are online