Memory allocation of 1D Arrays (C89 compiler)
Code:
#include<stdio.h>
void main()
{
int a[10];
a[15]=100;
printf("%d",a[15]);
}
this code snippet should not be compiled due to obvious reasons but it is getting compiled and it is also printing the value of a[15] as 100...Why so???? i searched and found about VLA (variable length array s in the C99 compiler ) but that is not the answer....would be very obliged if someone could give a proper answer.... I have tried different compilers like devC,turboC,ideone.org