Examples 14-A, 14-B and 14-C attempt to show how undetected (at compile-time) array-bound errors can cause problems --- compile and run them:
#include <stdio.h> main() { int k = 3000, a[10], j = 4000, i; printf("Value of j %d\n",j); for(i = 1; i <= 10; i++) a[i] = i; for (i = 1; i <= 10; i++) printf("%d \n",a[i]); printf("Value of j %d\n",j); } |
...previous | up (conts) | next... |