0
Write a program to input a string and replace all the occurrences of character T with @
3 Respostas
+ 5
Just do :
replace(str.begin(), str.end(), 'T', '@');
// Basically does the same thing
// as a for loop used to replace
// each character.
0
To see how it works:
for (char &c : str)
if (c == 'T')
c = '&';