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 can you quickly find the number of elements stored in a
a) static array b) dynamic array ?

Answer Posted / brainless

b) use pointer of last element - pointer of first element + 1

However, we should know the last element's pointer...

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how would you handle a situation where you cannot call the destructor of a local explicitly?

1018


What is the full form of dos?

1244


You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()

1219


What is friend class in c++ with example?

1116


Can a function take variable length arguments, if yes, how?

1069


What relational operators if statements in c++?

1233


What is the use of function pointer?

1073


Is map sorted c++?

1050


Define friend function.

1109


In the derived class, which data member of the base class are visible?

1161


Implement stack operations with pointers with appropriate exception checks.

1022


Is linux written in c or c++?

1087


How do you generate a random number in c++?

1150


Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.

2267


What are the advantages of using pointers in a program?

1190