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 difference between strcmp & palindrome?
write a program to find the given number is prime or not
2 Answers Accenture, Vasutech,
Explain what is the best way to comment out a section of code that contains comments?
what are two kinds of java
What is the real difference between arrays and pointers?
27 Answers Hexaware, Logic Pro, TCS,
convert 12345 to 54321 withoutusing strig
What is volatile
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
what is the difference between NULL & NUL keywords in C?
Are enumerations really portable?
main() { intj; while9j<=10) { printf("\n%d",j); j=j+1; } }
Define Array of pointers.