Right now, I want to handle data file in the following format:
apple 1234
coke 2344 some
grape 2345 null
....
as some lines consist of 3 element while some other have 2,I want to use the expression as follows to get the first two elements in every line and make them into a map or hash_map,
...
while(outClientFile>>name>>state)
pairs.insert(name,state);//
...
somehow,I figure out that it can not work because of the structure of fstream.so do you have any suggestions on this problem?