Question: language is C++ program 1 Write a function removeSpace that takes one string argument (by value), removes spaces from this string using stringstream, and returns

language is C++

program 1

Write a function removeSpace that takes one string argument (by value), removes spaces from this string using stringstream, and returns the resulting string. Write a main program to test your function. Your main program should:

- prompt the user to enter a string string1

- call the function removeSpace and send string1 as argument

- print the new string value.

Sample run:

Please enter a phrase: Welcome to CS211, let the fun begin

The resulting phrase is: WelcometoCS211,letthefunbegin

Program 2

Rewrite the function removeSpace from program 1 that removes spaces from this string using stringstream. The function is now a void function that takes one string argument by reference. Write a main program to test your function. Your main program should:

- prompt the user to enter a string string1

- call the function removeSpace and send string1 as argument

- print the new string value (in main not in the function).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!