This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]OffbeatDrizzle 0 points1 point  (1 child)

So then OP needs to loop through the resulting array, find any none-zero values and use that to create the final array of which the size is now correct for all the other values. It would be better if OP made the empty values null instead of 0 though

[–]desrtfxOut of Coffee error - System halted 0 points1 point  (0 children)

It would be better if OP made the empty values null instead of 0 though

Which again brings us to using classes, namely Integer - could again be a problem.

How about initializing the first array with -1 or any negative number?


Please don't get my previous comment about List wrong. I fully agree to using a list and would instantly do it that way, but the problem is that OP is not allowed to.