how to swap two strings without using any third variable ?
Answer Posted / santosh panigrahy
int main()
{
char *a = "hello";
char *b = "world";
a = a + (a-b);
b = a - (a-b)/2;
a = a - (a-b)*2;
printf(" a = %s b = %s ",a,b);
return 0;
}
| Is This Answer Correct ? | 26 Yes | 5 No |
Post New Answer View All Answers
Which bitwise operator is used to check whether a particular bit is on or off?
What is singleton class in c++?
Explain deep copy?
Why is c++ awesome?
List the types of polymorphism in c++?
Define basic type of variable used for a different condition in C++?
Which is the best c++ compiler for beginners?
Explain selection sorting. Also write an example.
Is there structure in c++?
How many standards of c++ are there?
Describe the syntax of single inheritance in C++?
Why pointer is used in c++?
Can you please explain the difference between using macro and inline functions?
Why is c++ still used?
Explain about Garbage Collector?