EmbLogic's Blog

c basics

what is the difference between NULL and NUL  ………………..??????

2 Responses to c basics

  1. NUL : A Character in the ASCII set with an ASCII value of 0. Used as a Control character or a String Terminator to indicate the End of Strings.

    NULL : It is an Address. It is used to Initialize pointers to indicate that the Pointer does not point to a Valid Object.
    Try this :
    int main()
    {
    printf(“%d %d”,sizeof(“”),sizeof(NULL));
    }

    More information can be found here :
    http://en.wikipedia.org/wiki/Null_character
    http://en.wikipedia.org/wiki/Null_pointer#Null_pointer

  2. Swarup mishra says:

    NULL is a macro defined in the header file for NULL POINTER
    while NUL is the name of first character in ASCII table that corresponds to the 0 decimal value.

Leave a Reply to Mandeesh Singh Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>