Question: The member function of the string class exchanges two strings. What is the output of the following code snippet? int main() { string str 1=

The member function of the string class exchanges two strings. What is the output of the following code snippet? int main() \{ string str 1= "I LOVE MY DOG"; string str 2= "I HATE MY CAT"; str 1. swap (str2); cout str 1 endl; cout str 2 endl; return ; \} I LOVE MYDOG I HATE MY CAT I LOVE MY DOG I LOVE MY DOG I LOVE MYCAT I HATE MY DOG I HATE MY CAT I LOVE MY DOG
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
