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
How do I write a c++ program?
Differentiate between an array and a list?
write a program that withdrawals,deposits,balance check,shows mini statement. (using functions,pointers and arrays)
What is the benefit of encapsulation?
Can we inherit constructor in c++?
Why do we use setw in c++?
Declare a class vehicle and make it an abstract data type.
Which is best c++ or java?
What is c++ hiding?
Why are pointers not used in c++?
Explain mutable storage class specifier.
Is c++ faster than c?
What are the differences between java and c++?
Is c++ the best programming language?
what are the iterator and generic algorithms.