Ok, got an update here... still got a few errors.
Code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string strInput;
cout << "\nPlease enter a gender specific sentence\n";
cout << "or enter `I'm done' to exit the program.\n";
getline(cin, strInput); //gets the user input
do
{
string::size_type loc = strInput.find("he", "him", 0);
if( loc = string::npos )
string strInput.replace("he", "he or she")||
string strInput.replace("him", "him or her")
cout << strInput;
else
cout << strInput;
}
while
(strInput != "I'm Done");
return 0;
}
}
Errors include:
- Error E2285 lab6.cpp 29: Could not find a match for 'string::find(char *,char *,int)' in function main()
- Warning W8060 lab6.cpp 31: Possibly incorrect assignment in function main()
- Error E2108 lab6.cpp 32: Improper use of typedef 'string' in function main()
- Warning W8004 lab6.cpp 39: 'loc' is assigned a value that is never used in function main()
Thanks for replying