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 / chitranshu asthana

char* s1 = "Hello";
char* s2 = "World";
s1 = (char*)((int)s1 + (int)s2);
s2 = (char*)((int)s1 -(int) s2);
s1 = (char*)((int)s1 - (int)s2);
printf("%s:%s", s1, s2);

Is This Answer Correct ?    91 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write about the retrieval of n number of objects during the process of delete[]p?

974


Explain the register storage classes in c++.

1145


What is the disadvantage of using a macro?

1051


What is bubble sort c++?

956


What do you mean by persistent and non persistent objects?

1356


What are structs in c++?

968


What are 2 ways of exporting a function from a dll?

1115


Which is best c++ or java?

1041


What is vector pair in c++?

1174


Should I learn c or c++ first?

1072


Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?

1196


What is the difference between mutex and binary semaphore?

1117


What is the basic concept of c++?

961


Can I uninstall microsoft c++ redistributable?

1037


Define token in c++.

1093