Im having trouble with dealing with arrays in c++, would someone please guide me on how to do something like below?
i want to set a value into an array, but don't want to overwite something already set in that array, instead i want it check if the array [] slot is not empty then if it's not empty, to go into an empty [] slot in that array to set its value, will appreciate any help!
Its a global array that will store values in it, it will be a float a[30] array, when i mean empty it will be set to 0, or not set at all, how would i do the above without overwriting any value in the array?
i want it check if the array [] slot is not empty then if it's not empty, to go into an empty [] slot in that array to set its value, will appreciate any help!
quote2
check if the index you're trying to use is empty:
if it is, then assign value.
I appreciate your efforts, but seriously how does quote one differ from quote 2? i am asking how to do this, a nice little example would be perfect.