I have this function that takes an array of 512 Vertices. (each one containing x,y,z coordinates). Anyway, I made a mistake and instead of accessing the array 512 times, I did it 513 times. Instead of "zeros" I got a number. I run it again, the same. I increased the iterations and the same thing again. Even though I was going beyond the limits of the array random values were showing up each time I the function. What are those values? Am I accessing anything in the OS? (it may sound stupid but im new to C++ and pointers)
void print_facet_array(FACET3 *f)
{
int i=0;
for (i=0;i<=513;i++)
{
printf("The vertices (x,y,z) for facet %d are: V_1 = x:%f , y:%f, z:%f. \n", i, f[i].p1.x, f[i].p1.y, f[i].p1.z);
printf("The vertices (x,y,z) for facet %d are: V_2 = x:%f , y:%f, z:%f. \n", i, f[i].p2.x, f[i].p2.y, f[i].p2.z);
printf("The vertices (x,y,z) for facet %d are: V_3 = x:%f , y:%f, z:%f. \n", i, f[i].p3.x, f[i].p3.y, f[i].p3.z);
}
}