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
What is the keyword auto for?
Should I learn c or c++ first?
What is one dimensional array in c++?
Do you know about C++ 11 standard?
Are vectors faster than arrays?
What does n mean in c++?
Why do we learn c++?
Is java as fast as c++?
Why is c++ difficult?
How do you master coding?
Is nan a c++?
Explain the scope of resolution operator.
What does count ++ do in c++?
What is flush c++?
How to implement is-a and has-a class relationships?