memory allocation checking

K

Kev

Hi

Is the preferred method when checking whether or not 'new' succeeded to use
'null' or 'throw/catch'(I think I have that right)? Ive seen both used.

Thx
 
H

Howard

Kev said:
Hi

Is the preferred method when checking whether or not 'new' succeeded to
use
'null' or 'throw/catch'(I think I have that right)? Ive seen both used.

Thx

The preferred method is to use a standard-compliant compiler, which throws
an exception when new fails.

(And it's NULL, not null, by the way.)

-Howard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top