example8.cpp 337 B

1234567891011121314151617
  1. #include <dumapp.h>
  2. int main() {
  3. int *pi;
  4. int i;
  5. #ifdef DUMA_EXPLICIT_INIT
  6. duma_init();
  7. #endif
  8. pi = new int[10];
  9. for (i = 0; i < 10; ++i)
  10. pi[i] = i;
  11. delete pi; // this line should produce error, cause pi was allocated with
  12. // new[]()
  13. // allocation source should be reported, cause dumapp.h is included
  14. return 0;
  15. }