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


Please Help Members By Posting Answers For Below Questions

Why c is called free form language?

799


What are the advantages of using linked list for tree construction?

882


Define the scope of static variables.

870


Why do we need a structure?

828


What is a macro, and explain how do you use it?

862


Can I initialize unions?

845


Why c is called a mid level programming language?

871


What are the application of c?

873


What does. int *x[](); means ?

861


What is printf () in c?

817


What is the value of uninitialized variable in c?

838


can anyone suggest some site name..where i can get some good data structure puzzles???

1877


Is anything faster than c?

814


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1381


How can a process change an environment variable in its caller?

959