reading values from a line of text
I've got a line of txt
EHRAUFE10235869496XXX 0938593863005003002049964006
and I have to read in only certain pieces of it.
this is what I've got so far.
int main()
{
char engine[5];
char major[4];
char minor[4];
// open file
infile.ignore(6,'\n'); // ignores the first 6 spaces or finds \n
infile.getline(engine,5); // asigns the next 5 to engine
/* so far it works fine, now I'm trying to get to the other side of the space to pick-up the major and minor cycles.*/
infile.ignore(14, '\n');
infile.getline(major,4);
// this one will not pick-up anything ?
any input would be great , maybe substr(pos, len) but I can't hget it to work at all.