Exforsys
+ Reply to Thread
Results 1 to 3 of 3

Dereferencing a NULL value

This is a discussion on Dereferencing a NULL value within the C and C++ forums, part of the Programming Talk category; Hi, What is the effect of dereferencing a pointer variable which has the value NULL? Charlie...

  1. #1
    CubDriver is offline Junior Member Array
    Join Date
    Jun 2007
    Answers
    2

    Dereferencing a NULL value

    Hi, What is the effect of dereferencing a pointer variable which has the value NULL?

    Charlie


  2. #2
    rachelle is offline Member Array
    Join Date
    Apr 2006
    Answers
    97
    First before answering to your question I will explain what is deferencing a pointer variable and this would clearly answer your question. Dereferencing a pointer variable reflects that the pointer is made to refer to some other location in memory. So as you have asked if you dereferencing a pointer variable which has the value NULL it would result in memory fragmentation/segmentation program.


  3. #3
    CubDriver is offline Junior Member Array
    Join Date
    Jun 2007
    Answers
    2
    Hi Rachelle,

    First of all, thanks for responding tot he question. I am very new at this and have read your response several times. I feel like the caveman in the GEICO commercial where the specialist they ask the caveman for his response to a womans comments He said ......Huh?!

    I think I get what youu are saying, but want to understand. Are you saying that the compiler will detect the error and issue an error message/ or will this make it through the compiler and you get a runtime error?

    Charlie


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...