program for swapping two strings by using pointers in c language



program for swapping two strings by using pointers in c language ..

Answer / 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

More C Interview Questions

totally how much header files r in c language

8 Answers   TCS,


I want tcs placement papers of 2004-2009 , its urgent

6 Answers   TCS, Wipro,


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

1 Answers  


What are register variables? What are the advantage of using register variables?

1 Answers   TISL,


What do you mean by Recursion Function?

1 Answers   Hexaware,


A stack can be implemented only using array?if not what is used?

3 Answers   InterGlobal,


What is console in c language?

1 Answers  


what is the use of a array in c

6 Answers  


what are the files which are automatically opened when a c file is executed?

3 Answers  


what will be maximum number of comparisons when number of elements are given?

1 Answers  


What does static variable mean in c?

1 Answers  


how to introdu5ce my self in serco

1 Answers  


Categories