C语言 链表系列
简单 链表
#include
typedef struct node
{
int data;
struct node *next;
}node;
node *head = NULL;
void traverse() //遍历
{
node *p = head;
while( p != NULL)
{
printf ("%d ",p -> data);
p = p -> next;
}
printf ("/n");
}
int main()
{
node n1 = {1,NULL};
node n2 = {2,NULL};
node n3 = {3,NULL};
node n4 = {4,NULL};
node n5 = {5,NULL};
node n6 = {6,NULL};
node n7 = {7,NULL};
node n8 = {8,NULL};
C语言 链表系列最先出现在Python成神之路。
共有 0 条评论