mohrk
asked on
C++ Homework Help Nested classes
Hi,
Alright 10 minutes into this thing and I am already stuck. I have a class Employee that seems fine, another class Student again fine.
Now I need a class TeachingAssistant nesting the first two classes. Sounds easy:
My header for just getting started:
When I go to implement TeachingAssistant it won't see it. I am including the above header file so I am not sure how to get further.
Thanks!
Alright 10 minutes into this thing and I am already stuck. I have a class Employee that seems fine, another class Student again fine.
Now I need a class TeachingAssistant nesting the first two classes. Sounds easy:
My header for just getting started:
#ifndef TEACHINGASSISTANT_H
#define TEACHINGASSISTANT_H
#include "Employee.h"
#include "Student.h"
class TeachingAssitant
{
public:
TeachingAssitant();
class Employee;
class Student;
};
#endif
When I go to implement TeachingAssistant it won't see it. I am including the above header file so I am not sure how to get further.
#include "stdafx.h"
#include "TeachingAssisstant.h"
using namespace std;
TeachingAssistant::TeachingAssistant() <- error
Thanks!
ASKER
I think intellisense would have picked all of that up but I retyped it all to be sure.
"It" doesn't seem to like my constructor for TeachingAssistant. I just compiled and have a ton of errors. I will work through them and post an update. Should have tried that first. The errors are mostly in the other classess and implementations.
Sorry I got frustrated.
Thanks!
"It" doesn't seem to like my constructor for TeachingAssistant. I just compiled and have a ton of errors. I will work through them and post an update. Should have tried that first. The errors are mostly in the other classess and implementations.
Sorry I got frustrated.
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Good tip thanks!
Also, your include for the .h looks like it has an extra 's'
Everything else looks like it should work.