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
Is there any function that can skip certain number of characters present in the input stream?
In a function declaration what does extern means?
Difference between overloading vs. Overriding
What is pointer with example?
What return value must conversion operators have in their declaration?
Explain object slicing in c++?
What is abstraction in c++ with example?
Why do we learn c++?
What's the "software peter principleā?
What is an incomplete type in c++?
List the issue that the auto_ptr object handles?
what are the iterator and generic algorithms.
What's c++ used for?
How do you find out if a linked-list has an end? (I.e. The list is not a cycle)
What are vectors used for in c++?