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

Is java based off c++?

709


What are the advantages of inheritance in c++?

842


How do you establish an is-a relationship?

816


What are the advantages of c++? Explain

773


What is the purpose of the "delete" operator?

799






What do you mean by function pointer?

809


Difference between inline functions and macros?

746


Which is better turbo c++ or dev c++?

744


What are the comments in c++?

751


Can member functions be private?

768


Does a derived class inherit or doesn't inherit?

810


Explain rtti.

774


Is oops and c++ same?

759


How is c++ used in the real world?

768


What are c++ files?

858