Hello,
I'm building a find and replace function for my text editor and I need a little help.
I'm building the function without help from the algorithm header.
The function is written like:
doc.find_replace("Word_to_be_replaced", "The_word_that_is_replacing");
I find this very easy to understand replace this, with this.
find_replace will both have char * as their arguments.
The problem I'm having right now if I replace a bigger word for a smaller word how do I delete the extra characters from memory.
So if I replace "Goodbye" with "Hello" how do I delete the last two characters? So I don't print garbage code.