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
As mentioned, extracting whitespace manually in the code you've shown is unnecessary. However, if you do come across a need for this in the future, you can do so with the std::ws manipulator.