Link to home
Start Free TrialLog in
Avatar of Geezy1984
Geezy1984

asked on

String Replacer

I am trying to write a program that will replace the word he in a string with she or he this is my code soo far and I am stuck on if I am going in the right direction or not... or what I should do from here if I am going in the right direction:

#include <iostream>
using namespace std;



string::size_type = unsigned int u[npos]
string str1 = "school";
string::size_type
pos=str1.find("he")
pos=str1.find("him")
pos=str1.find("his")
      if (pos==npos)
      
      }
      
void replace(string&stmt, string source, string test)
{
}

int main (){
cin >> getline.stmt;
replace (stmt, "he", "she or he");
replace (stmt, "him", "her or him");
replace (stmt, "his", "her(s) or his");
}

start loop
{
pos=startfind(source,start)
      if(pos!=npos)
            {
                  case:1      
ASKER CERTIFIED SOLUTION
Avatar of efn
efn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial