Could you use some other value as a "placeholder" - like -1 which won't be confused with real data?

Really though you need something better than arrays. Arrays have an unchanging length that is...