Dear Sir,
I am tring to convert integer to string and using string for further find and replace operations. While doing so I am using for loop to for integers and then wants to store all these integers in strings.
But I did not succeed. But If I use only one integer I can convert it into string and use it for further operations.
I am giving my part of program as follows;
for( j=x;j<y;j++)
{
std::stringstream tc;
tc<<j;
string integer=tc.str();
string search;
search=str+integer;
while(!pch.eof())
{
getline(pch,line);
assert(search!=replace);
string::size_type pos=0;
while ((pos=line.find(search,pos))!=string::npos)
{
line.replace(pos+search.size(),search.size(),replace);
pos++;
}
pchout<<line<<endl;
}
The program basic is as follows:
As I want to find certain numbers e.g suppose ranging from 60001 to 60010 at various locations in the file and then replacing them with some other strings.
Can anyone help me
Thank you in advance