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 you mean by vtable and vptr in c++?

1043


Using a smart pointer can we iterate through a container?

1084


What is the full form of stl in c++?

1196


What is helper in c++?

1093


What are the uses of pointers?

1076


write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;

2009


When should overload new operator on a global basis or a class basis?

1081


What do you mean by global variables?

1076


What is a character in c++?

1047


What is singleton pattern in c++?

997


How to access a variable of the structure?

1096


How do I write a c++ program?

1118


What are references in c++? What is a local reference?

1046


Difference between declaration and definition of a variable.

1166


Explain what are single and multiple inheritances in c++?

1028