C语言结构体和联合体

时间:2022-08-06 02:26:56

1、单链表插入

#include <stdio.h>
#include <stdlib.h> #define FALSE 0
#define TRUE 1
typedef struct NODE{
STRUCT NODE *link;
int value;
}Node; int sll_insert(Node *current,int newvalue)
{
Node *previous;
Node *new; while(current->value<newvalue){
previous =current;
current =current->link;
}
new =(Node *)malloc(sizeof(Node));
if( new == NULL)
return FALSE; new->value=newvalue;
new->link = current;
previous ->link=new;
return TRUE; } int main()
{
int result;
result=sll_insert(root,); return ;
}
待测--未调通