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
Why is c++ still popular?
What does flush do c++?
What apps are written in c++?
What are the classes in c++?
What is ios flag in c++?
What is c++ map?
Explain the difference between new() and malloc() in c++?
How many namespaces are there in c++?
Tell me difference between constant pointer and pointer to a constant.
What is an undefined behavior and sequence points
What is the standard template library (stl)?
A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
What is the use of lambda in c++?
Which software is best for programming?
How long will it take to learn programming?