ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Programming Languages >> C
 
 


 

 
 C interview questions  C Interview Questions (2254)
 C++ interview questions  C++ Interview Questions (1111)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (646)
Question
program for swapping two strings by using pointers in c language
 Question Submitted By :: C
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
#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 ?    3 Yes 1 No
Umesh
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
code for copying two strings with out strcpy() function.   6
who developed c and why he developed c?   5
how to write a data 10 in address location 0x2000   3
declare afunction pointer to int printf(char *)? HCL 1
main() { clrscr(); } clrscr(); ME 6
what is void pointer?   2
what is the need for main function in c?   5
What is the difference between static and global variables?   1
write a c program to add two integer numbers without using arithmetic operator + Value-Labs 13
in C-programming language without using printf statement can we get output r not ? if yes how and if no also how ? IBM 11
how to write a prog in c to convert decimal number into binary by using recursen function,   1
what is out put of the following code? #include class Base { Base() { cout<<"constructor base"; } ~Base() { cout<<"destructor base"; } } class Derived:public Base { Derived() { cout<<"constructor derived"; } ~Derived() { cout<<"destructor derived"; } } void main() { Base *var=new Derived(); delete var; } Honeywell 3
 
For more C Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com