Original Post
Hi I want to make a decryption program and therefore I need to read the ascii values from the input file.But there are .'s between the numbers(ie 95.51.27 ) I want to replace them with ''(also nothing) how can I do it ? Here is my code that doesn't work I dont understand why there are so many string::replace functions and why is it so hard in c++. It was very easy in other languages I used to program.
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
int a = 'd';
string sifre = "";
string fincik = "";
ofstream fout ("pw.out");
ifstream fin ("pw.in");
if(!fin.is_open())
return 0;
while(!fin.eof())
{
fin >> fincik;
sifre += fincik;
}
sifre.replace(sifre.begin(),sifre.end(),'.',' ');
fout << sifre <<endl;
return 0;
}