How can you quickly find the number of elements stored in a
a) static array b) dynamic array ?

Answer Posted / murali

for static array start from highest index to lowest (
normal conditions apply*)
if dynamic array is a Container type, size() / length()
will do. if not process the nodes.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Search for: what is pair in c++?

593


Explain what is class definition in c++ ?

599


Explain virtual destructor?

676


How do you establish an is-a relationship?

623


What are the operators in c++?

599






Can you explicitly call a destructor on a local variable?

602


What is the basic of c++?

606


What is data structure in c++?

663


What is the c++ programming language used for?

581


What are the manipulators in c++?

553


Write about the use of the virtual destructor?

612


State the difference between pre and post increment/decrement operations.

610


Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .

683


Is c++ an integer?

579


What is the use of lambda in c++?

582