voice_buffer = new char[no_of_bytes + 20]; input_file->ReadData(voice_buffer,no_of_bytes);
In C++, if the runtime system cannot allocate sizeof(Fred) bytes of memory during p = new Fred(), a std::bad_alloc exception will be thrown. Unlike malloc(), new never returns null! Therefore you should simply write: Fred * p = new Fred(); // No need to check if p is null
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)