I am having a problem. I need to make a function called replaceText that replaces a targeted text with new text. The null character is not included and if no targetText is found then there is no text replacement.
The parameters are two arrays targetText[] and replacementText[]. This is for an assignment and I cannot use str. Here is my code so far.
void SimpleString::replaceText(char targetText[], char replacementText[])
{
for ( int i = 0; i < MAX_LIST; i++)
{
if( replacementText[i] > MAX_LIST)
{
throw SimpleStringOverflowException("SimpleStringOverflowException: Resulting SImpleString too large.");
}
}
}
Here you go:
I assume you can use strlen….right? if not let me know…