I have a stack of numbers from 0-17 and i need to put that stack into List on first position how could i use function Insert? or do i have to somehow change Insert ?
This is my struct of List
struct List
{
int data;
struct List *Next;
};
and this is how i have my Insert
void Insert(List **pps, int prvek)
{
List *ps;
ps = (List *)malloc(sizeof(List));
if (!ps) {
return;
}
ps->data = prvek;
ps->Next = *pps;
*pps = ps;
}