[Solved] Reading garbage instead of segfault for non-existant memory locations


sizeof gives you the number of bytes the array occupies, not the number of elements it consists of. So as a double requires 8 bytes on your system, the result should become clear.

solved Reading garbage instead of segfault for non-existant memory locations