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 |
what is memory leak?
what is use#in c
What will happen when freeing memory twice
Write a simple code fragment that will check if a number is positive or negative.
what information does the header files contain?
6 Answers BSNL, Cisco, GDA Technologies,
wat are the two methods for swapping two numbers without using temp variable??
What are the properties of union in c?
Compare and contrast compilers from interpreters.
what is the use of ‘auto’ keyword?
what is the role you expect in software industry?
What are header files in c programming?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question