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
What is a syntax in c++?
Explain bubble sorting.
Who calls main function?
Describe friend function & its advantages.
Can I learn c++ as my first language?
What are the uses of typedef in a program?
How should a contructor handle a failure?
What operators can you overload in c++?
program explaining feautures of c++
What is the difference between the indirection operator and the address of oper-ator?
Explain how we implement exception handling in c++?
How do I exit turbo c++?
Can comments be nested?
What is an operator in c++?
Write a program which uses functions like strcmp(), strcpy()? etc