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

How static variables and local variablesare similar and dissimilar?

601


What is #include ctype h in c++?

708


What are the manipulators in c++?

577


What are the methods of exporting a function from a dll?

682


Why c++ is created?

605






the maximum length of a character constant can be a) 2 b) 1 c) 8

635


How many types of classes are there in c++?

629


How does a copy constructor differs from an overloaded assignment operator?

590


Which operations are permitted on pointers?

607


Is java a c++?

586


What is basic if statement syntax?

596


Explain the uses oof nested class?

659


What is an incomplete type in c++?

801


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

606


How long does it take to get good at leetcode?

698