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

How would you call C functions from C++ and vice versa?

1236


Can a Structure contain a Pointer to itself?

1204


How to defines the function in c++?

1215


What is the function of I/O library in C++ ?

1270


What are arithmetic operators?

1040


Difference between delete and free.

1135


How do you save a c++ program?

1086


Which format specifier is used for printing a pointer value?

1106


What is recursion?

2377


Can comments be longer than one line?

1123


Is c better than c++?

1134


What are move semantics?

1227


How do you print a string on the printer?

1081


What are the four partitions in which c++ compiler divides the ram?

1285


What is the difference between equal to (==) and assignment operator (=)?

1135