I made a class which will store all the information of a list of employees. I want to know how to read in from a file and seperate the information into where i want it like the adress as employee.address or the gender as employee.gender. I was trying to use getline but its not working how i want it to work. The text file looks like this:
Employee: John e. smith
address: 12 maple street new jersey, nj, 12345
phone number: 2341231222
gender: male
age:22
dependants:2
department:construction
union:yes
hourly rate:10.25
Employee: mark e. tan
address: 12 dark street new yokr, ny, 12345
phone number: 123456222
gender: male
age:29
dependants:2
department:sales
union:no
hourly rate:15.25
The text file will contain a lot more employees
Employee: John e. smith
address: 12 maple street new jersey, nj, 12345
phone number: 2341231222
gender: male
age:22
dependants:2
department:construction
union:yes
hourly rate:10.25
Employee: mark e. tan
address: 12 dark street new yokr, ny, 12345
phone number: 123456222
gender: male
age:29
dependants:2
department:sales
union:no
hourly rate:15.25
The text file will contain a lot more employees