Hey, I've created this class, it compiles OK but when I go to use the class it fails. It comes up with a pop-up saying something like 'Unexpected Error'
'Class'
class Person
{
public:
Person();
Person(char theName[], float thePay, int theHours, bool Isworker);
char* getName();
float getPay();
int getDepartment();
void setName(char theName[]);
void setPay(float thePay);
void setHours(int theHours);
void setSalaried(bool Isworker);
private:
char* name;
float pay;
int hours;
bool worker;
};
'Functions'
#include <string>
#include <iostream.h>
#include "person.h"
Person::Person(){}
Person::Person(char theName[], float thePay, int theHours, bool Isworker)
{
strcpy(name, theName);
pay = thePay;
hours = theHours;
worker = worker;
}
char* Person::getName()
{
return name;
}
float Person::getPay()
{
return pay;
}
int Person::getHours()
{
return hours;
}
void Person::setName(char theName[])
{
strcpy(name, theName);
}
void Person:: setPay(float thePay)
{
pay = thePayRate;
}
void Person::setHours(int theHours)
{
hours = theHoursWorked;
}
void Person::setSalaried(bool Isworker)
{
worker = Isworker;
}
Any ideas? Thanks.