Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to swap two strings without using any third variable ?

Answer Posted / rohit kapade

bool SwapString(char **s1,char **s2)
{
char *temp = NULL;
temp = *s1;
*s1 = *s2;
*s2 = temp;
//strcpy(temp,s1);
//strcpy(s1, s2);
//strcpy(s2, temp);
return true;
}

Is This Answer Correct ?    0 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain terminate() function?

1008


Explain the concept of memory leak?

1043


Which field is used in c++?

1047


What is expression parser in c++

2414


What data encapsulation is in c++?

1051


What is c++ virtual inheritance?

1073


Describe the advantage of an external iterator.

981


Can there be at least some solution to determine the number of arguments passed to a variable argument list function?

959


How delete [] is different from delete?

956


What do you mean by inheritance in c++?

1022


What are the three forms of cin.get() and what are their differences?

1153


Describe the role of the c++ in the tradeoff of safety vs. Usability?

1160


Can we specify variable field width in a scanf() format string? If possible how?

1152


Define a constructor - what it is and how it might be called (2 methods)?

1062


What is a terminating character in c++?

1320