Академический Документы
Профессиональный Документы
Культура Документы
h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "header.h"
void addnew (struct Node** head_ref, struct Node* p)
{
struct Node* q = (struct Node*) malloc(sizeof(struct Node));
int new_data;
scanf("%d",&new_data);
q->data=new_data;
if(p == NULL)
{
q->next = *head_ref;
*head_ref = q;
return;
}
else
{
q->next = p->next;
p->next = q;
}
}