reading hex values from fstream into int

前端 未结 4 1395
南笙
南笙 2020-12-22 01:39

I have a text file which has one hex value in each line. Something like

80000000
08000000
0a000000

Now i am writing a c++ code to read this

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-22 02:14

    ... and the way to change it is to use noskipws: f >> std::noskipws; will set no skipping of whitespace until you use std::skipws manipulator.

    But why do you want to read the '\n'? To make sure that there is one number per line? Is it necessary?

提交回复
热议问题