how to swap two strings without using any third variable ?
Answer Posted / chitranshu asthana
char* s1 = "Hello";
char* s2 = "World";
s1 = (char*)((int)s1 + (int)s2);
s2 = (char*)((int)s1 -(int) s2);
s1 = (char*)((int)s1 - (int)s2);
printf("%s:%s", s1, s2);
| Is This Answer Correct ? | 91 Yes | 13 No |
Post New Answer View All Answers
Write about the retrieval of n number of objects during the process of delete[]p?
Explain the register storage classes in c++.
What is the disadvantage of using a macro?
What is bubble sort c++?
What do you mean by persistent and non persistent objects?
What are structs in c++?
What are 2 ways of exporting a function from a dll?
Which is best c++ or java?
What is vector pair in c++?
Should I learn c or c++ first?
Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?
What is the difference between mutex and binary semaphore?
What is the basic concept of c++?
Can I uninstall microsoft c++ redistributable?
Define token in c++.