C string program

Can someone please show me how to do this?
replaceSubstring Function
Write a function named replaceSubstring. The function should accept three C-string or string object arguments. Let's call them string1, string2, and string3. It should search string1 for all occurrences of string2. When it finds an occurrence of string2, it should replace it with string3. For example, suppose the three arguments have the following values:
string1: "the dog jumped over the fence"
string2: "the"
string3: "that"
With these three arguments, the function would return a string object with the value "that dog jumped over that fence." Demonstrate the function in a complete program.
This is a program I could not figure out in my semester one programming class, and I set it aside to come back to it and I've come back to work on it and still can't figure it out.
What have you written so far? What specifically is confusing you?
Topic archived. No new replies allowed.