Question: Write a short program in C + + with the following functions: void input ( std::string &first, std::string &second ) requests two values of type
Write a short program in with the following functions:
void inputstd::string &first, std::string &second
requests two values of type string from the user, accepting the values from standard input
returns the accepted values by reference
void swapstringsstd: :string &first, std::string &second
accepts two string reference arguments and swaps the referenced values. In other words, the string stored at the first parameter ends up stored
in the second parameter and the string stored at the second parameter ends up stored in the first parameter.
void outputstd: :string &first, std: :string &second
that prints two strings to the screen with a space between them.
int main
Uses the input, swapstrings, and output functions to:
Accept two string values from the user.
Print the received strings in their original input order
Print the received strings in reverse of the original order.
Again, print the received strings in their original input order
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
