Array index runs from 0 to size-1. So for int myArray[16] the indexing is 0 to 15! not 1 to 16.
So the for loop should look like
for (1=0;i<16;i++){
}
There is no bounds checking in c/c++ so you will not be given any warning if you try to read/write outside the bounds to the array.
Writing out side the array will over write other data with random results
Mark
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||