# include <iostream>
using namespace std;

//链表
struct lianbiao {

    string name;

    int id;

    lianbiao* next;
};

void lianbiao_2() {

    lianbiao* jie1 = new lianbiao;
    lianbiao* jie2 = new lianbiao;
    jie1->name = "张三";
    jie1->id = 1001;
    jie1->next = jie2;

    jie2->name = "李四";
    jie2->id = 1002;
    jie2->next = NULL;

    cout << "节点一:" << jie1->name << " " << jie1->id << endl;
    cout << "节点二:" << jie2->name << " " << jie2->id << endl;
    delete(jie1);
    jie1->next = NULL;
    delete(jie2);
}

int main() {

    lianbiao_2();

}

详细讲解参见:http://c.biancheng.net/view/1570.html