I want to delete the first element from a list.
this is my list:
struct dlist {
int liber; //it translates as "free" don't know what this is
int nmax; //maximum number of elements
DATA *pv; //a pointer with which i can move in list, also DATA is int
};
typedef struct dlist Lista, *LISTA;
//my try so far
//it deletes the first element but you can guess what happens when i reach the last element. I've tried w/o for to no avail.
void delFirst(LISTA l)
{
LISTA *temp; int i;
if(!(empty(l)))
temp=l->pv[0];
for(i=0;i<(l->nmax)-1;i++)
l->pv[i]=l->pv[i+1];
free(temp);
}