home *** CD-ROM | disk | FTP | other *** search
/ C++ for Dummies (3rd Edition) / C_FD.iso / CHAP15 / CHAP15_3.CPP < prev   
C/C++ Source or Header  |  1996-09-15  |  391b  |  23 lines

  1. // Chap15_3.cpp
  2. // This won't compile due to ambiguities in the constructor.
  3. class Student
  4. {
  5.   public:
  6.    Student(char *pName  = "no name");
  7.    Student(Student&);
  8. };
  9. class Teacher
  10. {
  11.   public:
  12.    Teacher(char *pName  = "no name");
  13.    Teacher(Teacher&);
  14. };
  15. void addCourse(Student);
  16. void addCourse(Teacher);
  17.  
  18. int main()
  19. {
  20.    addCourse("Prof. Dingleberry");
  21.    return 0;
  22. }
  23.