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;
*s1 = (char*)((int)*s1 + (int)*s2);
*s2 = (char*)((int)*s1 - (int)*s2);
*s1 = (char*)((int)*s1 - (int)*s2);
return true;
}

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is function overloading c++?

1021


When is the destructor called?

978


Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..

3790


Do class declarations end with a semicolon? Do class method definitions?

1083


What is late binding c++?

926


Can you pass an array to a function in c++?

951


What is data hiding c++?

997


Can you Mention some Application of C/C++?

1009


What is buffering in c++?

1019


What does ctime() do?

1047


Which compiler does turbo c++ use?

1023


Is there a c++ certification?

992


How can virtual functions in c++ be implemented?

1058


Do you know what are static and dynamic type checking?

1014


How is static data member similar to a global variable?

1054