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;
//strcpy(temp,s1);
//strcpy(s1, s2);
//strcpy(s2, temp);
return true;
}
Is This Answer Correct ? | 0 Yes | 6 No |
Post New Answer View All Answers
Which bit wise operator is suitable for turning off a particular bit in a number?
What is new in c++?
What is a modifier in c++?
What is the meaning of c++?
What do you mean by translation unit in c++?
Describe delete operator?
why is iostream::eof inside a loop condition considered wrong?
Why do we use using namespace std in c++?
What is the difference between #define debug 0 and #undef debug?
What is a catch statement?
What sorting algorithm does c++ use?
Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..
What is the difference between the functions rand(), random(), srand() and randomize()?
Explain stack & heap objects?
Function can be overloaded based on the parameter which is a value or a reference. Explain if the statement is true.