Reference : http://www.cprogramming.com/tips/tip/cincrement-new-does-not-return-0-on-failure
C++ new는 할당실패시 bad_alloc exception을 던진다.
매번 try-catch 하기 귀찮으니까, malloc()처럼 오류상황에서 0을 리턴하게 만들고 싶은 경우, 다음과 같이 고친다.
#include <new> ... type_t *ptr = new (std::nothrow) type_t[size]; ...