leak2.cc 392 B

123456789101112131415161718192021
  1. #include <noduma.h>
  2. #include <iostream>
  3. #include <dumapp.h>
  4. using namespace std;
  5. int main() {
  6. cout << "Hello world!" << endl;
  7. int* pI = new int[10];
  8. cerr << "Let's leak a pointer to an array of 10 ints" << endl;
  9. for (int i=0; i<9; i++) {
  10. pI[i] = 303+i;
  11. }
  12. for (int i=0; i<9; i++) {
  13. if (pI[i] != 303+i) cerr << " Something strange is happening..." << endl;
  14. }
  15. return 0;
  16. }