Guest_imported
New member
- Jan 1, 1970
- 0
Daverit40 (Visitor) Mar 26, 2002
ok the txt file i'm reading from is structured like this...
1111 Johnny Smith 3.00 140.00
2222 Sammy Smith 4.00 173.00
etc...
I'm trying to read in each segment seperately into different structure members. My problem is when i try to read in the name segment I want it to stop reading at the end of the name but it continues to read in the entire rest of the line. For example, i use this code :
inputfile.seekg(6L, ios::beg);
inputfile.getline (EmpInfo[0].Name, 25)
and when i cout what was just retrieved, i get this output...
Johnny Smith 3.00 140.00
is there any way to get it to just read "johnny Smith" from the txt file?
ok the txt file i'm reading from is structured like this...
1111 Johnny Smith 3.00 140.00
2222 Sammy Smith 4.00 173.00
etc...
I'm trying to read in each segment seperately into different structure members. My problem is when i try to read in the name segment I want it to stop reading at the end of the name but it continues to read in the entire rest of the line. For example, i use this code :
inputfile.seekg(6L, ios::beg);
inputfile.getline (EmpInfo[0].Name, 25)
and when i cout what was just retrieved, i get this output...
Johnny Smith 3.00 140.00
is there any way to get it to just read "johnny Smith" from the txt file?