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
Explain terminate() function?
Explain the concept of memory leak?
Which field is used in c++?
What is expression parser in c++
What data encapsulation is in c++?
What is c++ virtual inheritance?
Describe the advantage of an external iterator.
Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
How delete [] is different from delete?
What do you mean by inheritance in c++?
What are the three forms of cin.get() and what are their differences?
Describe the role of the c++ in the tradeoff of safety vs. Usability?
Can we specify variable field width in a scanf() format string? If possible how?
Define a constructor - what it is and how it might be called (2 methods)?
What is a terminating character in c++?