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 is upcasting in C++?

1115


If a round rectangle has straight edges and rounded corners, your roundrect class inherits both from rectangle and from circle, and they in turn both inherit from shape, how many shapes are created when you create a roundrect?

1066


Are there any special rules about inlining?

1021


Which field is used in c++?

1047


What do the keywords volatile and mean mutable?

1004


How to declare an array of pointers to integer?

1066


How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?

2271


Can a new be used in place of old mallocq? If yes, why?

1036


How the programmer of a class should decide whether to declare member function or a friend function?

1063


find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.

2466


What does count ++ do in c++?

1150


What is token c++?

976


Evaluate the following expression as C++ would do :8 * 9 + 2 * 5 a) 82 b) 79 c) 370 d) list

948


What sorting algorithm does c++ use?

1074


When can I use a forward declaration?

1028