Re: NULL pointer not generating exception

Discussion in 'C++' started by Alf P. Steinbach, Aug 26, 2003.

  1. On 25 Aug 2003 23:42:16 -0700, (Boris Rogge) wrote:

    >Problem:
    >When calling a function on an object that is not allocated, no
    >null-pointer exception is generated.


    Anything or nothing can happen, since it's undefined behavior.

    Whatever happens (e.g. the harddisk spinning so as to reproduce
    the wailing from "Mars Attacks!") it's allowed by the standard.

    Simply don't call member functions via null-pointers.
     
    Alf P. Steinbach, Aug 26, 2003
    #1
    1. Advertisements

  2. Ron Natalie wrote:

    > "Alf P. Steinbach" <> wrote in message news:...
    >
    >
    >>Whatever happens (e.g. the harddisk spinning so as to reproduce
    >>the wailing from "Mars Attacks!") it's allowed by the standard.
    >>

    >
    > Fire and brimstone coming down from the skies. Rivers and seas boiling! 40 years of darkness, earthquakes, volcanos.
    > The dead rising from the grave! Human sacrifice, dogs and cats, living together... mass hysteria!
    >
    >


    ....

    I love you.

    -Kevin
    --
    My email address is valid, but changes periodically.
    To contact me please use the address from a recent posting.
     
    Kevin Goodsell, Aug 26, 2003
    #2
    1. Advertisements

  3. Kevin Goodsell wrote:
    > Ron Natalie wrote:
    >
    >> "Alf P. Steinbach" <> wrote in message
    >> news:...
    >>
    >>
    >>> Whatever happens (e.g. the harddisk spinning so as to reproduce
    >>> the wailing from "Mars Attacks!") it's allowed by the standard.
    >>>

    >>
    >> Fire and brimstone coming down from the skies. Rivers and seas
    >> boiling! 40 years of darkness, earthquakes, volcanos.
    >> The dead rising from the grave! Human sacrifice, dogs and cats,
    >> living together... mass hysteria!

    ...
    >
    > I love you.
    >


    Love fests are off topic.
     
    Gianni Mariani, Aug 26, 2003
    #3
    1. Advertisements

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. Replies:
    5
    Views:
    30,424
    Mike Schilling
    Mar 29, 2006
  2. Samuel Barber
    Replies:
    2
    Views:
    482
    Jack Klein
    Aug 28, 2003
  3. Ken
    Replies:
    69
    Views:
    13,421
    Michael D. Borghardt
    Jul 31, 2004
  4. Ken
    Replies:
    5
    Views:
    2,852
    Victor Bazarov
    Jul 24, 2004
  5. Dennis Allison

    interpreting a null pointer as an empty (null string)

    Dennis Allison, Mar 5, 2004, in forum: C Programming
    Replies:
    11
    Views:
    1,041
    Derk Gwen
    Mar 6, 2004
  6. Vincent RICHOMME

    NULL pointer and null references

    Vincent RICHOMME, Jan 15, 2006, in forum: C++
    Replies:
    3
    Views:
    469
  7. aneuryzma
    Replies:
    3
    Views:
    981
    Jim Langston
    Jun 16, 2008
  8. Christopher
    Replies:
    4
    Views:
    661
    Ruben Safir
    Jul 9, 2011
Loading...