Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

write a c program in such a way that if we enter the today date the output should be next day's date.

2136


What is pointer in c?

1140


What is difference between stdio h and conio h?

1325


Is c procedural or functional?

978


What is a good way to implement complex numbers in c?

994


Why do we use main function?

1112


What are lookup tables in c?

950


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2007


What is sorting in c plus plus?

925


Write a program to reverse a string.

1025


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

1043


How to create struct variables?

1044


What is the scope of global variable in c?

952


What are the 4 data types?

963


Do pointers need to be initialized?

1018