void New_list ( struct el * *start, struct el * *end )
{
struct el *g;
int x;
puts (Insert elements, to finish insert 0:" );
*start = NULL;
*end = NULL;
scanf("%d", &x);
while( x != 0 )
{
if ( *start == NULL)
{
g = (struct el *) malloc(sizeof(struct el));
g->elem = x;
g->next = NULL;
*end = g;
*start = g;
}
else
{
g = (struct el *) malloc(sizeof(struct el));
g ->elem = x;
g ->next = NULL;
(*end)->next = g;
*end = g;
}
scanf( "%d", &x );
}
}
I have this list and i need to insert a new element after a k element (k is from keyboard). I'm new to the arrows so i can't figure it how to do it.