Check if object array is empty

I know that an array cannot be "empty," but I need to check if there are still any VALUES in my array of objects

How do I do this?
What are you storing in the array and what do you consider an "empty value"?
This tidbit might help you, albeit it shows you an example of arrays of ints, so if you're doing an array of custom class objects, you'll have to do a little more footwork on that.

http://www.cplusplus.com/doc/tutorial/arrays/

It is an array of objects, basically I have an array which holds all the patients that are checked in, and I have a function which checks out patients. When I check out a patient, I need to remove the object from the array since it is no longer checked in.

I did this at first:

checkIn[i] = checkIn[i+1]

This shifts the array by 1 index which ultimately overwrites the index I want removed, is this method correct?
Sounds like it should work if you also have a variable that keeps track of how many patients you have. When you remove a patient you should not forget to decrement this variable.
Topic archived. No new replies allowed.