Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Strings Program String I need some help with this program. So I have to write a function called eraseSubstring; however I am slightly confused

C++ Strings Program String

I need some help with this program.

So I have to write a function called eraseSubstring; however I am slightly confused on what the use of the function prototype is for? Cant I just call the function to perform the eraseSubstring? Can you clarify what the protoype is used for in this case.

image text in transcribed

Write a function called eraseSubstring that erases the sequences "by" and "BY" from a string. The function prototype is as follows: void eraseSubstring(string& input, string substr); Where "input" is the input string and "substr" is the substring that should be erased from the input string. In this problem, substr "HousebyParkB YTree", the output should be "HouseParkTree". Write a main program to ask the user to input a string. Then call the above function to erase the substrings from the input string, and display the result

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago