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
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
Explain about block scope in c?
What is the sizeof () operator?
Explain continue keyword in c
What is a substring in c?
Is there a way to compare two structure variables?
What is null pointer in c?
What are the different types of data structures in c?
Explain what is the difference between the expression '++a' and 'a++'?
Who invented bcpl language?
what are non standard function in c
Differentiate between ordinary variable and pointer in c.
What is the purpose of clrscr () printf () and getch ()?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What is wrong in this statement? scanf(“%d”,whatnumber);