Exforsys

Online Training

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...


Go Back   Exforsys > Programming Talk > C and C++

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-07-2007, 05:27 PM
Junior Member
 
Join Date: Jun 2007
Posts: 2
CubDriver is on a distinguished road
Dereferencing a NULL value

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

Charlie
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-10-2007, 04:19 PM
Senior Member
 
Join Date: Apr 2006
Posts: 122
rachelle is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-10-2007, 08:44 PM
Junior Member
 
Join Date: Jun 2007
Posts: 2
CubDriver is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-15-2004 07:00 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-01-2004 07:01 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit Tech FAQ 0 06-01-2004 07:00 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 05-15-2004 07:00 AM
Apple II Csa2 FAQs: Telecom Hardware & Transfers, Part 20/25 rubywand@swbell.net Tech FAQ 0 04-04-2004 08:29 AM


All times are GMT -4. The time now is 12:37 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2004 - 2007 Exforsys Inc. All rights reserved.