(Latest Revision: 03/29/2000)
Discussion of How We "Glue" the List Class Code onto the Main
Program
+ including the *.h file in the main source
file,
#include <fstream.h>
#include <iostream.h>
#include <string>
#include "clientList.h"
+ declaring object(s) (variable(s)) of the
list class in the main program file,
typedef clientListClass clientData[2] ;
int main ()
{
clientData clientD ;
buildLists(clientD) ;
... // stuff not shown
return 0 ;
}
+ making calls in the main program file (not
the main function) to class methods
(operations),
// excerpt of "putClientInList"
if (gender == 'M') genderID = MEN ; //constant=0
else if (gender == 'F') genderID = WOMEN; //constant=1
posInList = clientD[genderID].ListLength() + 1;
clientD[genderID].ListInsert(posInList, item, success) ;
+ and compiling all source files together.
// creates one compiled image from all sources
g++ matchL3.cpp clientList.cpp