Write a program using C++: **String Maniplulation**?
Question:
See an advisor, talk to him, and isten to him.
should produce the following suggested changed version of the sentence:
See an advisor, talk to her or him, and listen to her or him.
************
HINT
************
Write a pattern matching function:
-> That returns to start index, of the fisrt instance of pattern in target.
-> Then the text to be edited for sexist language to be traversed for each instance of sexist language, searching and replacing instances as found.
Answer:
Do your homework for you? Why don't you post what YOU think it should be, and we'll tell you if you are right or not.
too much work for too little reward.
What left-wing feminist zealot gave this assignment? You should investigate the string.h package, specifically the strstr (substring) and strcpy (string copy) functions. String manipulation is much easier in Java, by the way.
You need to replace specific words with other words.
I think you should tokenize the string into words and store them in an array of strings.
Then search the array for sexist words and replace the word with a suitable correction.
It seems easier to me that way. then output the array as the sentence.
All of what I said can be done using standard C++ <string.h> library
More Questions & Answers...