mirror of
https://github.com/ioacademy-jikim/debugging
synced 2025-06-08 16:36:21 +00:00
20 lines
300 B
C++
20 lines
300 B
C++
/** Simple regression test triggering the C++ operators new and delete. */
|
|
|
|
#include <stdio.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
int zero = 0;
|
|
int* p = new int;
|
|
int* q = new int[733];
|
|
delete[] q;
|
|
delete p;
|
|
|
|
q = new int[zero];
|
|
delete q;
|
|
|
|
fprintf(stderr, "Success.\n");
|
|
|
|
return 0;
|
|
}
|