is there a c++ array element counting function
example:
input array size:6
output:the array size is 6 elements/indexes(0-5)//all i need is the number 6
there is this code in php named
1 2 3 4 5
<?php
$arr1[6]={1,2,3,4,5,6};
$arrcount=count(arr1);
echo $arrcount;//6 is the answer
?>
No. Arrays in C/++ don't have sizes in the sense that it cannot be obtained at run time. There's a way to obtain the size of an array at compile time, but it doesn't apply to all arrays. It depends on how the array was created: sizeof(array)/sizeof(*array)
C++ (not C), however, defines in its standard library a container called "vector", whose size can be obtained at run time.