|
![](/i/fill.gif) |
"[GDS|Entropy]" <gds### [at] hotmail com> wrote:
> So what happens is when I define the array to be say, 50, outside of the
> first function, the inside test might not return 50 valid positions with
> which to populate the array, in one instance resulting in an array of
> dimension_size 50 with only 28 valid populated values.
>
> I used a counter within the if conditional to verify this.
In such cases, I usually go for all the 50 hits, not increasing the loop
variable on a miss.
But having thought about the array problem, I happened to find something that I
guess will be a head-slapper for you. It was for me. See other thread.
> I think more common programming language functionality would do a lot to
> expand the capabilities of SDL.
Yeah, the SDL definitely needs a rework.
> >> The only issue that this has created has been arrays of unknown length,
> >> which are difficult to loop against.
So that is what you meant. Heck, you young people are so spoilt with OO
languages... :) When I was young, array sizes were *always* of fixed length...
BTW, strictly speaking we're not talking about a problem of unknown array
length, but undefined elements...
Post a reply to this message
|
![](/i/fill.gif) |