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
How can I recover the file name given an open stream or file descriptor?
Explain what is a stream?
what is the basis for selection of arrays or pointers as data structure in a program
When can a far pointer be used?
which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
What are disadvantages of C language.
What is the use of f in c?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What are unions in c?
In a header file whether functions are declared or defined?
Is c object oriented?
C language questions for civil engineering
Explain can the sizeof operator be used to tell the size of an array passed to a function?
What are the similarities between c and c++?