how to swap two strings without using any third variable ?
Answer Posted / ashutosh
say a = 10 and b = 20;
b = a + b;// b= 30
a = b - a;// a= 20
b = b - a;// b= 10
so now a = 20 b= 10
| Is This Answer Correct ? | 27 Yes | 16 No |
Post New Answer View All Answers
What is an accessor in c++?
What is size of string in c++?
Is c++ map a hash table?
Do class declarations end with a semicolon? Do class method definitions?
Define pure virtual function?
What is command line arguments in C++? What are its uses? Where we have to use this?
What is the use of 'this' pointer?
Explain overriding.
In the derived class, which data member of the base class are visible?
Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?
Why do we learn c++?
Explain the uses oof nested class?
How do I start a c++ project?
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
How many types of modularization are there in c++?