User forums > General (but related to Code::Blocks)
array elements fills with random value after 10th element codeblocks 13.12
meyumraaj:
Its not the debugger which is initializing the array values to 0
For Loop in the code is initializing value of 0 in each and every elements in the array but when for loop reached 10th element all the array values goes back to random values.
The problem is; I can't initialize array elements value to 0.
oBFusCATed:
I think you're wrong here.
One easy way to find out is to add another loop after your initialization loop that will print the values of the array on the screen.
raynebc:
He's being misled by it saying counts[0] is a series of 11 zeroes and that counts[1] is a nonzero value. If the bug that oBFusCATed mentioned is that it should instead read that counts[0] is 0 repeated 11 times and that counts[11] is nonzero, that would seem to be the cause for confusion.
meyumraaj:
It was just my confustion
Array was initialized properly and debugger was saying 11 times 0 :)
Thank You Very Much oBFusCATed and raynebc :D
Navigation
[0] Message Index
[*] Previous page
Go to full version