hello! how are you?
i was able to read in one with some blank lines like this:
R 2
T -3
$ 6
3
B -1
M 2
by using get(ch) and infile >> chr >> num
but this doesn't work for some blank lines..
data file looks like :
R 2
T -3
$ 6
3
B -1
M 2
i used getline(buffer , 255, '\n')
and char * token = strtok(buffer, " "
;
cout << "CHAR : " << token;
token = strtok(NULL, ' ');
this read in char correctly but gave me segmentation fault
look like it can't handle the bak lines
i get this print out:
CHAR : R NUM : 2
CHAR : T NUM : -3
segmentation fault
can you help me to read in thisdata file?
thanks millions
Q
i was able to read in one with some blank lines like this:
R 2
T -3
$ 6
3
B -1
M 2
by using get(ch) and infile >> chr >> num
but this doesn't work for some blank lines..
data file looks like :
R 2
T -3
$ 6
3
B -1
M 2
i used getline(buffer , 255, '\n')
and char * token = strtok(buffer, " "
cout << "CHAR : " << token;
token = strtok(NULL, ' ');
this read in char correctly but gave me segmentation fault
look like it can't handle the bak lines
i get this print out:
CHAR : R NUM : 2
CHAR : T NUM : -3
segmentation fault
can you help me to read in thisdata file?
thanks millions
Q