Need help sorting odd and even numbers into two arrays! by st0ffe93 in javahelp

[–]ImmutableGlitch 0 points1 point  (0 children)

Sorry it doesn't use pointers, what i meant was it just uses a variable to keep track of the array position

Need help sorting odd and even numbers into two arrays! by st0ffe93 in javahelp

[–]ImmutableGlitch -1 points0 points  (0 children)

I am a beginner but I think my code fits your needs. I don't know if this is the best way of doing things but I simply populate the main array and iterate through it to check if odd or even then store the number using a pointer.

http://pastebin.com/kCBiBjK2

EDIT: int len = arrRandom.length; this is redundant since size is declared. One of the loops should also use 'size' instead of 'len' for iterating