How to make function that can add the new node between fist and last node
for example
20 40
add new value 30
list 20 30 40
add new value 50
list 20 30 50 40
Code:
#include <stdio.h>
#include <stdlib.h>
struct Node
{
int Data;
struct Node * Next;
};
struct Node * Add_New ( int n, struct Node * Pointer)
{
struct Node *New = malloc(sizeof(*New));
// return Pointer;
}
int main ()
{
struct Node * Head = NULL;
struct Node * Tail = NULL;
struct Node * Head = malloc(sizeof(*Head));
struct Node * Tail = malloc(sizeof(*Tail));
return 0;
}