All variables always have something "stored" in them. So if you have an array of size 5, then you have 5 elements stored.
If you want to instead keep track of which elements have been assigned, you will have to do that on your own by keeping track of your own variable.
Could you give me a hint in how to keep track?
Well it would depend on how you are assigning elements.
Each time you assign an element that has not previously been assigned... just increment your counter by 1.
Alright. I got it. I added an int variable and use that in storing a new item.
Thanks.