example1.cpp 245 B

1234567891011121314
  1. #include <stdlib.h>
  2. int main() {
  3. int *pi;
  4. int i;
  5. #ifdef DUMA_EXPLICIT_INIT
  6. duma_init();
  7. #endif
  8. pi = (int *)malloc(10 * sizeof(int));
  9. for (i = 0; i < 11; ++i)
  10. pi[i] = i; // this line should produce error with i == 10
  11. return 0;
  12. }