I'm trying to find a way to find a way to search for a string in a char array then replace it with another string every time it occurs. I have a fair idea of what to do but the whole syntax behind streams sometimes confuses me. Anyway my code so far (and it isnt very much) is:
string FindWord = "the";
string ReplaceWord = "can";
int i = 0;
int SizeWord = FindWord.length();
int SizeReplace = ReplaceWord.length();
while ( Memory[i] != '\0')
{
//now i know I can probably use a for loop and
//then if and else statements but im just not quite sure
i++; //and then increment my position
}
Im not usually this slow :/ any ideas?