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
Describe the process of creation and destruction of a derived class object?
What are the different types of comments allowed in c++?
Can a program run without main function?
Explain unexpected() function?
What is #include iostream h in c++?
What problems might the following macro bring to the application?
What is functions syntax in c++?
What is low level language in simple words?
Can you pass a vector to a function?
What is c++ coding?
What is c++ stringstream?
Can non graphic characters be used and processed in C++?
What is lvalue?
What is cin clear () in c++?
What is c++ try block?