返回的是引用还是指针?

解决方案 »

  1.   

    参见:MFC,CObList::GetHead
    Gets the CObject pointer that represents the head element of this list.CObject*& GetHead( );
    const CObject*& GetHead( ) const;
    Return ValueIf the list is accessed through a pointer to a const CObList, then GetHead returns a CObject pointer. This allows the function to be used only on the right side of an assignment statement and thus protects the list from modification. If the list is accessed directly or through a pointer to a CObList, then GetHead returns a reference to a CObject pointer. This allows the function to be used on either side of an assignment statement and thus allows the list entries to be modified.
      

  2.   

    如果链表被访问通过一个const的CObList,就返回一个指针
    下句自己翻译吧!
      

  3.   

    我想知道这是什么语法
    void*& 这个东西是指针呢还是引用呢,还是什么呢?
    我见过返回void *
    也见过返回int &
    还没见过返回void* &的。
    我知道了,这样写就很清楚了(void*) & 
    返回的是一个指针的引用。