Okay, so I have narrowed the problem having to do with the #ifndef
and/or the #define
keywords.
I have 2 other .h
files and the only difference between the ones with no errors and the ones without is the syntax highlighting on the #ifndef EMPLOYEE_H
and the #define EMPLOYEE_H
is swapped on the file with errors.
I'm not sure what that means though (I am using Visual Studio), but it's causing all of my other defined statements to go white like they are being included in some.
I'm not sure what's wrong!
Here is my code:
//Specification file for the Employee Class
#ifndef EMPLOYEE_H
#define EMPLOYEE_H
#include <string>
using namespace std;
class Employee
{
protected:
//Employee name
string name;
//Required Training hours
string emNum;
//Completed training hours
string hireDate;
public:
//Default Constructor
Employee()
{
name = " ";
emNum = " ";
hireDate = " ";
}
//Constructor
Employee(string aName, string aNumber, string aDate)
{
name = aName;
emNum = aNumber;
hireDate = aDate;
}
//mutators
void setName(string empName) { name = empName; }
void setEmployeeNumber(string empNumber) { emNum = empNumber; }
void setHireDate(string date) { hireDate = date; }
//accessors
string getName() const { return name; }
string getEmployeeNumber() const { return emNum; }
string getHireDate() const { return hireDate; }
#endif
};
My Errors are:
Error 1 error C2059: syntax error : '}'
Error 2 error C2143: syntax error : missing ';' before '}'
4 IntelliSense: expected a declaration
Blockquote
Also the error is highlighting the
};
at the very end.