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?

Showing Answers 1 - 11 of 11 Answers

auromita

  • Jul 22nd, 2006
 

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.

  Was this answer useful?  Yes

shaanxxx

  • Aug 20th, 2006
 

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.

  Was this answer useful?  Yes

tirthankar

  • Feb 27th, 2007
 

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

  Was this answer useful?  Yes

dasam

  • Mar 31st, 2007
 

NULL MACRO : #define NULL 0NULL Pointer : int* ptr = NULL; //points to no whereuninitialised pointer : int* ptr; //points to anywhere

  Was this answer useful?  Yes

vivianyang

  • May 11th, 2008
 

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.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions