sort data from int and char mixed format

I have file with data like this
148D
124D
225D
236D
259D

I need the data in the following format;

148
124
225
236
259

I dnt understand how to omit the char.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
#include <sstream>

int main()
{
    std::istringstream file( R"(
148D
124D
225D
236D
259D
                              )" ) ;

    int number ;
    char throw_it_away ;
    while( file >> number >> throw_it_away ) std::cout << number << '\n' ;
}

http://coliru.stacked-crooked.com/a/bf5488f0d8946e20
thank u!!
Topic archived. No new replies allowed.