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;
}
Answer Posted / sachin chakote
only first letter will be swapped
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the size of a vector?
What is c++ array?
Is c++ map a hash table?
What do you mean by volatile and mutable keywords used in c++?
Which software is best for programming?
What is endl?
What are c++ variables?
What is the c++ programming language used for?
What happens if a pointer is deleted twice?
What is the use of string in c++?
What's c++ used for?
Which operator cannot be overloaded c++?
Why c++ is created?
How can I learn c++ easily?
can any one help to find a specific string between html tags
which is changed to a sting..
weather.html looks (for location) is