#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef struct LINKLIST
{
int data;
struct linklist *next;
} LINKNODE,*LINKLISTP;
LINKLISTP insert_head (LINKLISTP head,linklistp newnode)
{
ASSERT (head);
ASSERT (NewNode);
newnode->next=head;
Head=newnode;
return head;
}
LINKLISTP insert_tail (LINKLISTP head,linklistp newnode)
{
return head;
}
LINKLISTP insert_local (LINKLISTP head,linklistp newnode)
{
return head;
}
void output (LINKLISTP head,linklistp newnode)
{
LINKLISTP Temp=head;
while (temp)
{
printf ("%d", temp->data);
temp=temp->next;
}
printf ("\ n");
}
int main ()
{
LINKLISTP Head=null;
Srand (Time (null));
int i=0;
for (i=0;i<10;i++)
{
LINKLISTP newnode= (LINKLISTP) malloc (sizeof (Linknode));//Get new node NewNode
Newnode->data=rand ()%100;
newnode->next=null;
Head=insert_head (Head.newnode);
Output (head);
GetChar ();
}
}
Ask the big God, compile with dev error ....??????????????????????
Data structure linked list insert implementation