Hi how are you all , i have an input files that contains string like this
===========================================================
input.txt
03_20_18
6B_20_15
0B_20_12
6F_20_0F
77_20_0C
07_20_09
1B_20_06
2B_20_03
0F_20_03
00_00_01
------------------------------------------------------------------
My question is how to delete _ (underscores) and the output is the numbers without _ (underscores)
thanks
ok i tried your advices and know its work , but still have a problem in printing out
i want to print like this
-----------------------------------------------------------------------------------------------------
032018
6B2015
0B2012
6F200F
77200C
072009
1B2006
2B2003
0F2003
000001
_________________________________________________________________-
here is my code
#include<iostream>
#include<fstream>
#include<string>
#include<cstdlib>
#include<cmath>
usingnamespace std;
int main()
{
ifstream infile;
infile.open("input.txt");
if (infile.fail())
{
cout << "The file doesn't open" << endl;
exit(1);
infile.close();
}
string line;
while (!infile.eof())
{
infile >> line;
for (int i = 0; i <= line.size(); i++)
if (line[i] != '_')
cout << line[i];
}
return 0;
}
my code is print like this
----------------------------------------------------------------------------------------------
032018 6B2015 0B2012 6F200F 77200C 072009 1B2006 2B2003 0F2003 000001