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 |
C program to perform stack operation using singly linked list
Why is struct padding needed?
how does a general function , that accepts an array as a parameter, "knows" the size of the array ? How should it define it parameters list ?
What is realloc in c?
WHAT IS C?
1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?
Do pointers take up memory?
what is mallloc()?how it works?
# define x=1+4; main() { int x; printf("%d%d",x/2,x/4); }
What are the 3 types of structures?
Differentiate between functions getch() and getche().
Hi, main() { } Is a user defined function or Built in Functionn