You compile the main program and the class GradeBook
independently. Then link them to generate an executable
program.:
g++ -c fig03_13.cpp
g++ -c GradeBook.cpp
g++ fig03_13.o GradeBook.o -o GradeBook
3.8 Validating Data with set Functions
The implementation of
setCourseName() is modified to make sure the length of
courseName is no longer than 25 characters.
The class interface
remains unchanged.
The main program need not
change, but here it adds some statements to demonstrate how it
validates the length of data member courseName.