Thread: Reading a NULL pointer

  1. #1
    Banned
    Join Date
    Apr 2015
    Posts
    596

    Reading a NULL pointer

    Hi guys, we know that NULL pointer is "nothing" but in terms of PC it's address of 0;
    so once I write *(NULL) , how does the PC deal with? I know that *NULL isn't compilable, but how does the PC deal with reading NULL pointer? is he going to address 0 and then figuring out that there's no value there?! how the concept going exactly?!

    thanks alot

  2. #2
    Banned
    Join Date
    Apr 2015
    Posts
    596
    Quote Originally Posted by RyanC View Post
    Hi guys, we know that NULL pointer is "nothing" but in terms of PC it's address of 0;
    so once I write *(NULL) , how does the PC deal with? I know that *NULL isn't compilable, but how does the PC deal with reading NULL pointer? is he going to address 0 and then figuring out that there's no value there?! how the concept going exactly?!

    thanks alot

    I mean, once I write a code, how should I visualize NULL pointer?! how should I think about it to use it in a correct way in my code?!

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,537
    Bored now - go read your previous threads.
    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. About NULL pointer
    By RyanC in forum C Programming
    Replies: 3
    Last Post: 12-02-2018, 07:32 PM
  2. Null pointer vs uninitialized pointer
    By Abhishek Kumar in forum C++ Programming
    Replies: 23
    Last Post: 03-05-2014, 12:01 PM
  3. Does static initialization of pointer make it null pointer
    By Saurabh Mehta in forum C Programming
    Replies: 1
    Last Post: 11-23-2012, 12:05 AM
  4. Null Pointer
    By saswatdash83 in forum C Programming
    Replies: 3
    Last Post: 07-15-2008, 04:12 AM
  5. pointer always NULL?
    By endo in forum C++ Programming
    Replies: 5
    Last Post: 08-14-2002, 03:10 AM

Tags for this Thread