In article <11*********************@i3g2000cwc.googlegroups.c om>,
hk**********@hotmail.com wrote:
hello again..
i want to design a program which takes in a string and replaces all 's'
characters with 'sh'. how do i do it? thanks a lot!
#include <cassert>
#include <string>
void replace( string& line, const string& from, const string& to )
{
// insert code here.
}
int main()
{
string myString = "s";
replace( myString, "s", "sh" );
assert( myString == "sh" );
}
Insert code at the spot that says "insert code here" until the program
exists without the assert aborting it.
--
There are two things that simply cannot be doubted, logic and perception.
Doubt those, and you no longer*have anyone to discuss your doubts with,
nor any ability to discuss them.