摘要: #include <bits/stdc++.h> using namespace std; typedef int ElemType; struct LNode{ ElemType data; LNode *next; }; LNode *head,*tail; void init(){ head = (LNode*)malloc(sizeof(LNode)); head->next = NULL 阅读全文
posted @ 2019-09-22 18:42 AWCXV 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 输入数字,-1结束就好要记住在新申请节点的时候,这样写LNode *temp = (Lnode*)malloc(sizeof(LNode));即指向LNode的一个指针。因为malloc返回的就是一个指针。 阅读全文
posted @ 2019-09-22 15:06 AWCXV 阅读(1205) 评论(0) 推荐(0) 编辑