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
Difference between Function to pointer and pointer to function
What is local and global variable in c?
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
What is the total generic pointer type?
What is masking?
How many levels deep can include files be nested?
What is a pointer value and address in c?
How can I recover the file name given an open stream or file descriptor?
What are lookup tables in c?
What is the use of typedef in c?
How are structure passing and returning implemented?
Write a code to generate divisors of an integer?
Write a program of advanced Fibonacci series.
How many keywords are there in c?
What is getch () for?