Is there a way to find how many values an array has? Detecting whether or not I've reached the end of an array would also work.
C++ – How to find the length of an array
arraysc
Related Topic
- Php – Deleting an element from an array in PHP
- C++ – The Definitive C++ Book Guide and List
- C++ – the “–>” operator in C/C++
- Javascript – How to remove a specific item from an array
- Javascript – How to add new array elements at the beginning of an array in Javascript
- Java – Why is processing a sorted array faster than processing an unsorted array
Best Answer
If you mean a C-style array, then you can do something like:
This doesn't work on pointers (i.e. it won't work for either of the following):
or:
In C++, if you want this kind of behavior, then you should be using a container class; probably
std::vector
.