memory allocation checking

Discussion in 'C++' started by Kev, Sep 15, 2005.

  1. Kev

    Kev Guest

    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
     
    Kev, Sep 15, 2005
    #1
    1. Advertising

  2. Jon Slaughter, Sep 15, 2005
    #2
    1. Advertising

  3. Kev

    Howard Guest

    "Kev" <> wrote in message
    news:Xns96D26DC01E02Dkevsmail@216.168.3.44...
    > 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
     
    Howard, Sep 15, 2005
    #3
  4. Kev

    Kev Guest

    Kev, Sep 15, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kwijibo28
    Replies:
    6
    Views:
    1,162
    tom_usenet
    Aug 11, 2003
  2. Ken
    Replies:
    24
    Views:
    3,944
    Ben Bacarisse
    Nov 30, 2006
  3. benben
    Replies:
    16
    Views:
    612
    Frank Puck
    Jul 31, 2005
  4. chris
    Replies:
    6
    Views:
    1,031
    chris
    Oct 28, 2005
  5. Bjarke Hammersholt Roune
    Replies:
    14
    Views:
    1,222
    Bjarke Hammersholt Roune
    Mar 6, 2011
Loading...

Share This Page