zl程序教程

您现在的位置是:首页 >  其他

当前栏目

(void (*Visit)(const ElemType &))[通俗易懂]

amp 通俗易懂 const void visit elemtype
2023-06-13 09:11:33 时间

大家好,又见面了,我是你们的朋友全栈君。

template <class ElemType>
void LinkList<ElemType>::Traverse(void (*Visit)(const ElemType &)) const//引用函数,函数指向指针
{ 
   
    Node<ElemType> *p=head->next;//新建指向节点类指针p,指针指向头结点的next
    while (p!=NULL){ 
   
    (*Visit)(p->data);
    p=p->next;
    }
    }

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/146236.html原文链接:https://javaforall.cn