Link to home
Start Free TrialLog in
Avatar of ubuntuguy
ubuntuguyFlag for United States of America

asked on

C++ Counting number of elements an array can hold

Hi I'm trying to get some skills in C++.  I'm a total newbie here.  So I'm trying to write a function that will count the number of elements that an array can hold without using a variable to hold this number.

I know in java I could say something like  array.length();  I think this is also possible in C++, something like sizeof *array, but is there a way to calculate the size of the array without using sizeof or using a variable to hold the number?
 



 
   
ASKER CERTIFIED SOLUTION
Avatar of masheik
masheik
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial