-
String Replace!
writing a function:
Code:
void StrReplace(wchar_t *OrgStr, wchar_t *RepStr)
{
}
I've another function that returns the position of the substring I find in the original:
like:
Code:
int FindStr(wchar_t *OrgStr, wchar_t *Find)
{
}
So, How can I proceed?
-
-
Iterate through the orgstr, until it starts equaling find, then keep going, and if it equals until you hit the end of find, then it's found. To replace, I don't think that it could only take two parameters like that.
Go read that thread you made in C++ again, go read about premature optimization, and re-evaluate your problem and reasoning behind doing this. If you just want experience doing it the hard way, okay, but just look at where you are now after the result of that thread. This could be made so much easier with STL.