read Number from text file using CPP stream

Posted by Yongwei Xing on Stack Overflow See other posts from Stack Overflow or by Yongwei Xing
Published on 2010-06-13T07:49:28Z Indexed on 2010/06/13 7:52 UTC
Read the original article Hit count: 196

Filed under:

Hi all

I have a text file like below

2 1 2
5 10 13 11 12 14
2 0 1
2 99 2
200 2
1 5
5 1 2 3 4 5
1 0
0 0

I want to read file line by line, and read the umbers from each line. I know how to use the stream to read a fixed field line, but what about the non-fixed line?

Best Regards,

© Stack Overflow or respective owner

Related posts about c++