Okay, thats helpful. Thank you. Now, I think I'm headed in the correct direction but ran across another error.
project.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#include "division.h"
#include "project.h"
#include <algorithm>
#include <cassert>
#include <cstdlib>
using namespace std;
Project::Project(int maxStaff)
: theProjectID(""), theBudgetCode(""), theDivision(0), numStaff(0),
theMaxStaff(maxStaff)
{
staff = new Staff[maxStaff];
}
Project::iterator Project::begin() const
{
return staff;
}
Project::iterator Project::end() const
{
return staff + numStaff;
}
/**** insert your operations for Projects here ***/
std::ostream& operator<< (std::ostream& out, Project::const_iterator p)
{
out << p.getTitle << "\t"
<< p.getDivision << "\t"
<< p.getProjectID << "\t"
<< p.getBudgetCode << "\t"
<< "\n";
return out;
}
|
I put the operator in project.cpp and it looks like this (, starting on line 36).
I get these errors:
Z:\CS330\Assignment 1\project.cpp|36|error: 'Project::const_iterator' has not been declared|
Z:\CS330\Assignment 1\project.cpp||In function 'std::ostream& operator<<(std::ostream&, int)':|
Z:\CS330\Assignment 1\project.cpp|38|error: request for member 'getTitle' in 'p', which is of non-class type 'int'|
Z:\CS330\Assignment 1\project.cpp|39|error: request for member 'getDivision' in 'p', which is of non-class type 'int'|
Z:\CS330\Assignment 1\project.cpp|40|error: request for member 'getProjectID' in 'p', which is of non-class type 'int'|
Z:\CS330\Assignment 1\project.cpp|41|error: request for member 'getBudgetCode' in 'p', which is of non-class type 'int'|
||=== Build finished: 5 errors, 0 warnings ===|
Before I have it the way I posted, the operator functions p.getTitle, p.getDivision and such all had () at the end of them but that did not fix it.
ex: p.getTitle() << .......
Any more guidance? Thank you guys for helping me. You are a godsend.