Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


this is to swap to strings....but in output the whole
strings are swapped leaving first as it is...why it is so

#include<iostream.h>
int main()
{
char a[]="ajeet";
char b[]="singh";
long x=*a;
long y=*b;
cout<<x<<":"<<y;
x=x+y;
y=x-y;
x=x-y;
*a=x;
*b=y;
cout<<x<<":"<<y;
cout<<&a<<endl;
cout<<&b<<endl;
}



this is to swap to strings....but in output the whole strings are swapped leaving first as it is.....

Answer / sachin chakote

only first letter will be swapped

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Why is c++ difficult?

0 Answers  


What are the important differences between c++ and java?

0 Answers  


What is the difference between Class and Structure?

40 Answers   HP, IBM, Samsung, TCS,


Can you please explain the difference between overloading and overriding?

0 Answers  


What is istream and ostream in c++?

0 Answers  


What are friend functions?

1 Answers  


Explain "passing by value", "passing by pointer" and "passing by reference" ?

5 Answers  


What is the use of object in c++?

0 Answers  


Which is the best c++ compiler for beginners?

0 Answers  


Should I learn c or c++ or c#?

0 Answers  


What does iomanip mean in c++?

0 Answers  


What is c++ iterator?

0 Answers  


Categories