Question: /* We have defined a function surround that takes a string pointer and a char as input, and surrounds the pointed-to string with that character.

 /* We have defined a function surround that takes a string

/* We have defined a function surround that takes a string pointer and a char as input, and surrounds the pointed-to string with that character. Call it on the values indicated below.

*/

#include using namespace std;

void surround(string* a, char ch) { // surround the string with copies of ch *a = ch + *a + ch; }

int main() { string name = "Tommy"; char hyphen = '-'; // surround name with hyphens surround(/* fill in here */ ); cout We have defined a function surround that takes a string pointer and a char as input, and surrounds the pointed-to string with that character Call it on the values indicated below. #include using namespace std; void surround(string* a, char ch) // surround the string with copies of ch *a = ch + *a + chl int main)f string name - "Tommy char hyphen = '-'; // surround name with hyphens surround (/* fill in here*/ cout

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!