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

What is a syntax in c++?

1163


Explain bubble sorting.

1096


Who calls main function?

1115


Describe friend function & its advantages.

1135


Can I learn c++ as my first language?

1113


What are the uses of typedef in a program?

1088


How should a contructor handle a failure?

1195


What operators can you overload in c++?

1044


program explaining feautures of c++

2442


What is the difference between the indirection operator and the address of oper-ator?

1120


Explain how we implement exception handling in c++?

1061


How do I exit turbo c++?

1076


Can comments be nested?

1033


What is an operator in c++?

1068


Write a program which uses functions like strcmp(), strcpy()? etc

1104