Could you go into more detail about what exactly is happening? Currently you are adding to uninitialized values, so you could get anything. Also, reading into array directly like that is a recipe for disaster as array is meant to be the memory address of the start of the array, not its values or anything like that.