How to reverse a string using a recursive function, without
swapping or using an extra memory?
Answer Posted / mahendra aseri
Reverse a string
void ReverseString (char *String)
{
char *Begin = String;
char *End = String + strlen(String) - 1;
char TempChar = '\0';
while (Begin < End)
{
TempChar = *Begin;
*Begin = *End;
*End = TempChar;
Begin++;
End--;
}
}
Is This Answer Correct ? | 24 Yes | 27 No |
Post New Answer View All Answers
Why c is called free form language?
What are the advantages of using linked list for tree construction?
Define the scope of static variables.
Why do we need a structure?
What is a macro, and explain how do you use it?
Can I initialize unions?
Why c is called a mid level programming language?
What are the application of c?
What does. int *x[](); means ?
What is printf () in c?
What is the value of uninitialized variable in c?
can anyone suggest some site name..where i can get some good data structure puzzles???
Is anything faster than c?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
How can a process change an environment variable in its caller?