C++ 知识综合解析与实践
1. 链表操作基础
在 C++ 编程中,链表是一种常见且重要的数据结构。以下是链表操作的基本代码示例:
newlink->next = first; //it points to next link
first = newlink; //now first points to this
}
//--------------------------------------------------------------
void linklist::display() //display all links
{
link* current = first; //set ptr to first link
while( current != NULL ) //quit on last link
{
cout << endl << current->data; //print data
current = current->next; //move to next link
}
}
//--------------------------------------------------------------
linklist::~linklist() //destructor
{
link* current = first; //set ptr to first link
whil
超级会员免费看
订阅专栏 解锁全文
11万+

被折叠的 条评论
为什么被折叠?



