c++ help please

every time i try to run my program i keep getting an identification error for empInfo. i tried putting int empInfo; but it wont work can someone please help me out. thank you in advance for your help


#include <stdlib.h>
#include <iostream>
using namespace std;

class employee
{
private:
int id, maxHours;
float payRate;

public:
void setInfo (int pin, float pay, int hours)
{
empInfo[pin].id = pin;
empInfo[pin].payRate = pay;
empInfo[pin].maxHours = hours;
}

void viewInfo (int record)
{
cout << empInfo[record].id;
cout << endl << empInfo[record].payRate;
cout << endl << empInfo[record].maxHours;
}

};
int main ( )
{
int pin, hours, record;
float pay;

employee empInfo[1000];

cout << "Enter employee 3 digit ID: ";
cin >> pin;
cout << "Enter employee pay rate: ";
cin >> pay;
cout << "Enter employee max hours: ";
cin >> hours;

empInfo[pin].setData(pin, pay, hours);

cout << "Enter the employee ID# of the record you wish to view: " << endl;
cin >> record;

empInfo.viewDate(record);

system("PAUSE");
return 0;
}
empInfo is declared in main but random methods inside the employee class are trying to modify it.
I go to the lounge to relax!
You should put this in the beginner's fourm
Topic archived. No new replies allowed.