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
In which language linux is written?
What is ambagious result in C? explain with an example.
What is wrong with this declaration?
Explain what is the difference between #include and #include 'file' ?
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
What is the use of ?: Operator?
Explain the properties of union. What is the size of a union variable
write a program to create a sparse matrix using dynamic memory allocation.
What is character set?
What is sizeof array in c?
What is meant by operator precedence?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
why do some people write if(0 == x) instead of if(x == 0)?
Explain Basic concepts of C language?
What are the primitive data types in c?