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 use of default constructor?
Which is most difficult programming language?
What is the use of setprecision in c++?
Do you know the use of vtable?
What is std :: flush?
What are the advantage of using register variables?
What is a driver program?
Is swift a good first language?
Explain rtti.
Who invented turbo c++?
Is c++ harder than java?
What do you mean by static variables?
What is the full form of ios?
How do you declare a set in c++?
Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.