This is what I have so far:
I am trying to replace all instances of 'the' with 'that'. I know it should be fairly simple, but for some reason, I need some help.
Also, do any of you experience peculiar program errors when running Microsoft Visual Basic? I've had to reinstall mine several times...
Thanks in advance.
Code:
// This program changes 'the' to 'that'
#include <iostream>
#include <string>
using namespace std;
// Function prototype
void replaceSubstring(string1, string2, string3);
int main ()
{
// Define three string objects.
string string1, string2, string3;
// Assign values to all three.
string1 = "the dog jumped over the fence";
string2 = "the";
string3 = "that";
return 0;
}
//************************************************************
// Definition of the replaceSubstring function. This function*
// searches the strings for 'the'. *
//************************************************************
void replaceSubstring(string1, string2, string3)
{
string1.find('the'); // Find 'the'
string1.insert("that");
}
Also, do any of you experience peculiar program errors when running Microsoft Visual Basic? I've had to reinstall mine several times...
Thanks in advance.
Comment