Why is the position of the footer element obtained in this way?
-sharpdefine OK 1
-sharpdefine ERROR 0
typedef int ElemType;
typedef struct
{
ElemType* elem;
int length;
int listsize;
} SqList;
int ListDelete(SqList* L, int i, ElemType* e)
{
int j;
ElemType *p, *q;
if (i < 1 || i >= L->length)
{
return ERROR;
}
p = &(*L).elem[i - 1]; //p
*e = *p;
q = (*L).elem + (*L).length - 1; //
for (PPp; p <= q; PPp)
{
*(p - 1) = *p; //
}
(*L).length--;
return OK;
}