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 |
how do we remove the printed character in printf statement and write next it it
What are the features of the c language?
what are bit fields in c?
why program counter is 16 bit?
main() { int l=6; switch(l) { default:l=l+2; case 4:l=4; case 5:l++; break; } printf("%d",l); }
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
What is gets() function?
#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf("\n%d",j) i+=j; } }
main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) { x=x+y; } y++; printf("The values of x and y are %d and %d."x,y); } What is the output?
What is modifier & how many types of modifiers available in c?
How can I direct output to the printer?
an algorithem for the implementation of circular doubly linked list