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...

program for swapping two strings by using pointers in c language

Answer Posted / umesh

#include <stdio.h>
void fastSwap (char **k, char **l)
{
char *t = *k;
*k = *l;
*l = t;
}
int main ()
{
char num1[] = "abc";
char num2[] = "def";
fastSwap ((char**)&num1,(char**)&num2);
printf ("%s\n",num1);
printf ("%s\n",num2);
return 0;
}

Is This Answer Correct ?    9 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does dm mean sexually?

1325


What does return 1 means in c?

1077


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1177


Explain how can I convert a string to a number?

1106


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

1029


What does 2n 4c mean?

1241


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

1065


Differentiate between a structure and a union.

1296


What are linked lists in c?

1132


Write a program to generate the Fibinocci Series

1243


What is pass by reference in functions?

851


How many types of arrays are there in c?

1049


What is the use of pragma in embedded c?

1063


What is openmp in c?

1027


What are header files? What are their uses?

1222