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

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

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!