Write a function which takes one string variable (not C string) as input and app
ID: 3635836 • Letter: W
Question
Write a function which takes one string variable (not C string) as input and appends additional information to the existing string. The function must get a first and last name from the user and add them to the original string so the final string appears as follows:original_string_content|first_name|last_name
You must add the '|' character to the string as shown. Use an appropriate parameter passing mechanism. Do not write a main function. Make sure to properly format all your code.
Explanation / Answer
here is the function u wantit will take a string as a parameter and i is called by reference and the tow first and last strings with the the tow " | | " will be added to it PLEASE RATE void add_string(string &N){string first,last;cin>>first>>last;N=N+"|"+first+"|"+last;}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.