Potential pitfall of ‘new’ operator in C++: Missing ‘NULL’

I faced a very interesting problem in a C++ code. The code logic was as follows: #include<stdio.h> int main() { int *p = new int(); int* B[10]; for ( int i =0; i<10; i++) { delete p; //p = NULL; printf(“Address1 =  %x\n”, p); int *q = new int(); printf(“Address2 =  %x\n”, q); B[i] = … More Potential pitfall of ‘new’ operator in C++: Missing ‘NULL’