<<edit: split from here>>
Hi. My i ask something?,,can you help me please to solve this Problem?
How Can i call Full Record using strtok and strcmp in text file
Please!!!!
101, Carlito Caballero, 500.00
102, tina gamboa, 560.34
103, angel caballero,750.55
104, kyla shane, 850.32
Here's the code
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <string>
using namespace std;
int main()
{
string IDNum;
string fname;
string lname;
string cost;
ifstream record;
record.open("myRecord.txt");
if (!record)
{
while (!record.eof() )
{
for(int i = 5; !record.eof(); i++)
{
cout<<"Enter ID Number: ";
cin>>IDNum;
getline(record, IDNum, ' ' );
cout<<"IDNum: "<<IDNum<<endl;
getline(record, fname, ' ');
cout<<"fname: "<<fname<<endl;
getline(record, lname, ' ');
cout<<"lname: "<<lname<<endl;
getline(record, cost, '\n');
cout<<"cost: "<<cost<<endl;
cout<<"---------------------------------"<<endl;
}
}
}
record.close();
}
All i want is to get only one record in my text file