I write some codes as follows:
If my printing code is as follow:Code:int main() { int a[2]; a[0] = 1; a[1] = 1; return 0; }
The result is "segmentation fault";Code:printf("%d\n",a[100]); //a[100] not defined
how can I write code to test a[100];
(I means if a[100] is defined, print
if a[100] is not defined, printf("a[100] is not defined.\n")
how can I carry out?