How do get the array length?

Elements were added to the array alright,

No, memory you didn't own was dumped on. All wrong.

Why is this? Not really random, are they.

No, they are pseudo-random and because you didn't seed the the pseudo-random number generator with a random number, it returned the same sequence.