By Sverre Hendseth

Dr. Dobb's Journal June 1997

void reftest (int &ref);
main ()
{
    int *pInt = 0;
    reftest (*pInt);  // no crash
                     // here
}
void reftest (int &ref)
{  ref = 32;    }       // crash
                       // here

Example 1: Pointing to zero.

Back to Article


Copyright © 1997, Dr. Dobb's Journal