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 |
In a switch statement, explain what will happen if a break statement is omitted?
char ch=10;printf("%d",ch);what is the output
Are comments included during the compilation stage and placed in the EXE file as well?
Why is c fast?
can we execute the program with the object file
Is file a keyword in c?
write a program to find lcm and hcf of two numbers??
What is a floating point in c?
find the output of the following program main() { int x=5, *p; p=&x; printf("%d",++*p); }
how to convert an char array to decimal array
What functions are in conio h?
How do shell structures work?