Thread: Pointers v References

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Join Date
    Apr 2008
    Location
    USA
    Posts
    76
    Quote Originally Posted by CornedBee View Post
    It just doesn't mean what rudyman thinks it means.
    If null is defined as 0, and you can create a reference to 0, then you can create a reference to null. I somehow managed to say that in the most poorly worded way possible, but I was just pointing out that although technically there's no reason or use for it, it is possible to assign and check a reference to be null.
    Last edited by rudyman; 06-30-2008 at 09:51 AM.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by rudyman View Post
    If null is defined as 0, and you can create a reference to 0, then you can create a reference to null. I somehow managed to say that in the most poorly worded way possible, but I was just pointing out that although technically there's no reason or use for it, it is possible to assign and check a reference to be null.
    While technically possible, it would rather assume that the object pointed to (referred to, referee), is rather 0 or does not have a reasonable value, but the reference itself is still valid, hence it isn't really a null reference.
    It is technically possible to emulate a null reference via C++ classes, though, if you really want a null reference.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Variable pointers and function pointers
    By Luciferek in forum C++ Programming
    Replies: 11
    Last Post: 08-02-2008, 02:04 AM
  2. MergeSort with array of pointers
    By lionheart in forum C Programming
    Replies: 18
    Last Post: 08-01-2008, 10:23 AM
  3. array of pointers to an array pointers
    By onebrother in forum C Programming
    Replies: 2
    Last Post: 07-28-2008, 11:45 AM
  4. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 09:32 AM