CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C DETAILS
Question :
What is a null pointer?
Category C Interview Questions
Rating (4.1) By 8 users
Added on 10/22/2004
Views 6776
Rate it!
Answers:

There are times when it?s necessary to have a pointer that doesn?t point to anything. The macro NULL, defined in <stddef.h>, has a value that?s guaranteed to be different from any valid pointer. NULL is a literal zero, possibly cast to void* or char*. Some people, notably C++ programmers, prefer to use 0 rather than NULL.

The null pointer is used in three ways:

1) To stop indirection in a recursive data structure

2) As an error value

3) As a sentinel value



Null pointer assignment really means that you are using an pointer that points to address location zero.Usually,This address location contains some information about compiler and if it is accessed and modified the original information is modified and when programmed is terminated the information block is checked and if the original information is changed then it is confirmed that a null pointer assignment has been taken place and that warns for null pointer assignment.



 Posted by: A.Mohan Kumar    

Contact A.Mohan Kumar  Contact A.Mohan Kumar

it has address of null value



 Posted by: khaja    

Contact khaja  Contact khaja


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What is a void pointer?
View Answer
Is NULL always defined as 0?
View Answer
What does it mean when a pointer is used in an if statement?
View Answer
Can you add pointers together? Why would you?
View Answer
How do you use a pointer to a function?
View Answer
When would you use a pointer to a function?
View Answer
Why should we assign NULL to the elements (pointer) after freeing them?
View Answer
Is it better to use malloc() or calloc()?
View Answer
What is the difference between far and near?
View Answer
When should a far pointer be used?
View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/1009/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.62