第一部分:
#include<iostream>
using namespace std;
typdef struct node{
int n;
struct node *next;
}*node;
//定义自定义头文件
功能部分:
bool start(node *head) {
head->next=NULL;
head->n=0;
}
bool listempty(node *head) {
node->next=NULL;
node->n=0;
return true;
}
void output(node *head) {
node *p=head->next;
whlie(p!=NULL) {
cout<<p->n<<" ";
p=p->next;
}
}
主函数
int main() {
node list;
start(&list);
output(&list);
}
自己写的链表,如有问题,感谢指出。