Read into an array of a class from a text file

I need to read into an array of Employees from a text file.
Here is my header file (which I know is correct)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class Employee
{
	
  public:
      Employee();			//default constructor
	  Employee(string, string, string, double, int);
	  
	  void Update(string, string, string, double, int);
	  void Display();
	  int FindIt(string);
	  double PayCalc(double);
	  string GetFirstName();
	  string GetLastName();

  
	// in private are the things that can only be seen from
	// the Employee class.
  private :
      string fname;
	  string lname;
	  string id;
	  double pay;
	  int    benefit;
};




I thought I got it to read in by creating arrays of each data type in the input file, but that was not correct.
Also, after the file is read in how am I supposed to have each instance separate from each other? After I figure out how to read in the file, I need to create a binary search, but how as an array of Employees supposed to equal a string??


But first things first, I need a little guidance on how to read this file into an array of a class.
Last edited on
Topic archived. No new replies allowed.