home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ for Dummies (3rd Edition)
/
C_FD.iso
/
CHAP10
/
CHAP10_2.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-02
|
862b
|
61 lines
// Chap10_2.cpp
#include <iostream.h>
class Student
{
public:
Student()
{
cout << "constructing student\n";
semesterHours = 0;
gpa = 0.0;
}
~Student()
{
cout << "destructing student\n";
}
//...other public members...
protected:
int semesterHours;
float gpa;
};
class Teacher
{
public:
Teacher()
{
cout << "constructing teacher\n";
}
~Teacher()
{
cout << "destructing teacher\n";
}
};
class TutorPair
{
public:
TutorPair()
{
cout << "constructing tutor pair\n";
noMeetings = 0;
}
~TutorPair()
{
cout << "destructing tutor pair\n";
}
protected:
Student s;
Teacher t;
int noMeetings;
};
int main()
{
TutorPair tp;
cout << "back in main\n";
return 0;
}