how to swap two strings without using any third variable ?
Answer Posted / rohit kapade
bool SwapString(char **s1,char **s2)
{
//char *temp = NULL;
//temp = *s1;
//*s1 = *s2;
//*s2 = temp;
*s1 = (char*)((int)*s1 + (int)*s2);
*s2 = (char*)((int)*s1 - (int)*s2);
*s1 = (char*)((int)*s1 - (int)*s2);
return true;
}
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
What is function overloading c++?
When is the destructor called?
Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..
Do class declarations end with a semicolon? Do class method definitions?
What is late binding c++?
Can you pass an array to a function in c++?
What is data hiding c++?
Can you Mention some Application of C/C++?
What is buffering in c++?
What does ctime() do?
Which compiler does turbo c++ use?
Is there a c++ certification?
How can virtual functions in c++ be implemented?
Do you know what are static and dynamic type checking?
How is static data member similar to a global variable?