int main (void) { int *x = new int; *x = 7; int *arr = new int[*x]; arr[0] = 3; arr[6] = -2; delete arr; // legal but causes memory leak! delete x; }