111000 in a string, and then type this format in another string
something ... something ...
the final (replaced?) string shout be the following:
something 111 something 000
i have written the following code:
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main()
{
string ss; //do not use it here
string s;
cout << "write some 1 and 0 "<< endl;
getline (cin, ss);
cout << "write some . (dots) and some text"<< endl;
getline (cin, s);
replace( s.begin(), s.end(), '.', '1' );
cout << s << endl;
system("pause");
return 0;
}
with this code i am testing replace(), but I still cant find any solution to implement string ss so that the dots can be replaced by the content of ss string and not by '1'.

New Topic/Question
Reply



MultiQuote




|