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...

Write a function which takes a character array as input and
reverses it in place.

Answer Posted / gumnam

void reverse(char *a)
{
char tmp;
int len = strlen(a) - 1;

for (int i = 0; i < len/2; i++)
{
tmp = a[i];
a[i] = a[len - i];
a[len - i] = tmp;
}
}

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do the keywords volatile and mean mutable?

1050


What is the purpose of the "delete" operator?

1055


What is c++ vb?

1083


What is a hashmap c++?

1114


What do nonglobal variables default to a) auto b) register c) static

1148


What are virtual functions in c++?

1179


Why should we use null or zero in a program?

1030


What is an operator in c++?

1057


How do I run c++?

1061


What is the use of 'this' pointer?

1246


Explain what you mean by a pointer.

1099


Can union be self referenced?

1144


How do you declare A pointer to function which receives an int pointer and returns a float pointer

1201


Can constructor be private in c++?

1037


If a header file is included twice by mistake in the program, will it give any error?

1040