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 hash table in c?
main() { int x, arr[8]={11,22,33,44,55,66,77,88}; x=(arr+2)[3]; printf(ā%dā,x); }
What are the basic data types associated with c?
main() { int i; for(i=0;i<5;i++) printf("%d",1l<<i); } why doesn't 'l' affect the code??????
Can i use Two or More Main Funtion in any C program.?
what is the main use of c where it can use the c
who is the father of c
what is the basis for selection of arrays or pointers as data structure in a program
How can I allocate arrays or structures bigger than 64K?
What is array within structure?
Which of the following is not a valid declaration for main ()? 1) int main() 2) int main(int argc, char *argv[]) 3) They both work
What is signed and unsigned?