GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Programming  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 223 of 426    Print  
What is a null macro?
What is the differtents between a null pointer and a null macro?
What is near, far and huge pointer?
How many bytes are occupied by them?
How would you obtain segment and offset addresses from a far address of a memory location?

  
Total Answers and Comments: 5 Last Update: June 05, 2008     Asked by: ShanthiSenthilKumar 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 22, 2006 07:28:54   #1  
auromita        

RE: What is a null macro? What is the differte...

Null macro is defined in stdio.h and stddef.h.It is used to represent a null pointer in your code.

its value is zero.

Null pointer is same as an uninitialized pointer..It does not point anywhere.


 
Is this answer useful? Yes | No
August 20, 2006 06:52:04   #2  
shaanxxx        

RE: What is a null macro? What is the differte...
NULL MACRO = (void *) 0Null pointer contains zeroth location chat *ptr = 0;you can use zero instead of NULL macro (I AM TALING ABOUT C). It will harm you.
 
Is this answer useful? Yes | No
February 27, 2007 14:17:10   #3  
tirthankar        

RE: What is a null macro?
NULL Macro is simply what is defined as 0 in a macro provided by the library

Null pointer is a pointer which has 0 or NULL value stored and points to nowhwere still it points to 0x00 i.e. the first memory location of the OS

Null pointer != Uninitialized pointer because an uninitialised pointer can point anywhere in the memory location ...but a NULL pointer surely points to no where(but still behind the scene we can say that it only points to 0x00). Never we can retrive a Null pointer location using th"&" operator..neither will malloc/calloc return NULL IF THERE IS SPACE IN THE MEMORY. NULL pointer is unique !!

 
Is this answer useful? Yes | No
March 31, 2007 08:29:20   #4  
dasam Member Since: March 2007   Contribution: 33    

RE: What is a null macro? What is the differte...
NULL MACRO : #define NULL 0NULL Pointer : int* ptr = NULL; //points to no whereuninitialised pointer : int* ptr; //points to anywhere
 
Is this answer useful? Yes | No
May 11, 2008 21:41:41   #5  
vivianyang Member Since: May 2008   Contribution: 1    

RE: What is a null macro? What is the differtents between a null pointer and a null macro?What is near, far and huge pointer? How many bytes are occupied by them?How would you obtain segment and offset addresses from a far address of a memory location?
A null pointer should not be confused with an uninitialized pointer: a null pointer is guaranteed to compare unequal to any valid pointer, whereas depending on the language and implementation an uninitialized pointer might have either an indeterminate (random or meaningless) value or might be initialised to an initial constant (possibly but not necessarily NULL).

In C and C++ programming, two null pointers are guaranteed to compare equal; ANSI C guarantees that any NULL pointer will be equal to 0 in a comparison with an integer type.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape