hello! thanks millions in advance for your help..
i have to read in two columns of data file....
datafile look like this:
F 2
G 3
K -3
? 8
- 1
W -2
6
M 3
$ -1
first item is character(letters, white space, ?@$%^&, etc)
there are one or more white space between char and integer...
integer can be either positive or negative...
i used ifstream : ifstream infle >> buffer
and check to see i read in order so
cout << buffer ;
and i was able to read everything but white space!!!!!
it skiped the white space and messed up the char and int ordering....char int char int int char int...i need that whitespace..
i also used getline(buffer, 100) and this doesn't work either....
get() is good choice but there are unknown numbers of white space between char and int....
i can' t think of any other way....
please help ...
i am making doubly circular linked list
i have to insert char and int into the node in order it read from the file....int is a way of moving in the list positive means move forward that number of position: 3 mean advance forward 3 nodes...negative means retreat backward ...
thanks a lot again..
Q
i have to read in two columns of data file....
datafile look like this:
F 2
G 3
K -3
? 8
- 1
W -2
6
M 3
$ -1
first item is character(letters, white space, ?@$%^&, etc)
there are one or more white space between char and integer...
integer can be either positive or negative...
i used ifstream : ifstream infle >> buffer
and check to see i read in order so
cout << buffer ;
and i was able to read everything but white space!!!!!
it skiped the white space and messed up the char and int ordering....char int char int int char int...i need that whitespace..
i also used getline(buffer, 100) and this doesn't work either....
get() is good choice but there are unknown numbers of white space between char and int....
i can' t think of any other way....
please help ...
i am making doubly circular linked list
i have to insert char and int into the node in order it read from the file....int is a way of moving in the list positive means move forward that number of position: 3 mean advance forward 3 nodes...negative means retreat backward ...
thanks a lot again..
Q