今天在实现一个单链表的时候,想借助一个函数完成链表头节点的初始化
#include<stdio.h>
#include<stdlib.h>
// this program is to give an examble of single list
// this program contain three algorithem . those are insert,delect and print
typedef struct node{
int data;
struct node* next;
} Lnode;
int init(Lnode* head);
int main(void)
{
char ch;
Lnode *head;
int nodeData;
if(init(head))
printf("the head node has been assigned\n");
printf("%d",head->data); //---------------------->这里出错了
return 0;
}
int init(Lnode *