Thread: void and null pointers

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    4

    Lightbulb void and null pointers

    can any one tell me the differece between void and null pointers ???

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,666
    Code:
    char c;
    void *p1 = NULL;
    void *p2 = &c;
    char *p3 = NULL;
    char *p4 = &c;
    void* is a type, NULL is a value.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Printing null pointers
    By SterlingM in forum C++ Programming
    Replies: 2
    Last Post: 03-18-2010, 06:04 PM
  2. NULL-pointers
    By Drogin in forum C Programming
    Replies: 2
    Last Post: 10-11-2009, 10:24 AM
  3. null pointers
    By ygfperson in forum C++ Programming
    Replies: 2
    Last Post: 03-29-2002, 07:49 PM
  4. Pointers Question.....Null Pointers!!!!
    By incognito in forum C++ Programming
    Replies: 5
    Last Post: 12-28-2001, 11:13 PM
  5. Pointers and NULL
    By []--JOEMAN--[] in forum C++ Programming
    Replies: 1
    Last Post: 12-11-2001, 01:49 AM