well I would like to know how to change number by letter, I would like to replace the number 1
with :x:
Here's my code:
string stng;
printf("Enter with number:");
cin >> stng;
replace(stng.begin(), stng.end(), '1', 'x');
cout << stng << endl;
as you can see I'm using this to replace: replace(stng.begin(), stng.end(), '1', 'x');
but as soon as I can only change 1
for x
, I want to replace for :x: