nil究竟是指的什么不为零?是一个类的大小,还是一个类所占内存大小?请大家帮帮忙?thanks

解决方案 »

  1.   

    The reserved word nil is a special constant that can be assigned to any pointer. When nil is assigned to a pointer, the pointer doesn抰 reference anything.
      

  2.   

    给你个c++的例子
    CRen *cr=new CRen(szName,nCode);
    ......
    delete cr;
    cr=NULL;
    nil 和NULL一个道理的
      

  3.   

    nil是一个特殊的值,  他只和指针有关系
    和类或者对象都没有关系
    nil可以赋给一个指针  ,他通知编译器,该指针不指向任何内存地址nil并不代表某个东西为0