Here are the typedefs, I thought I had everything planned out on paper and working but when I ran it I keep getting crashed program.
Just trying to remove element from LinkedList, I am setting the temp 1 behind the index that I am trying to remove then setting that tempo to the second temp that is pointing to what the "Removee" next.
Code:
typedef struct NodeT
{
NodeItemT info;
struct NodeT *next;
} NodeT;
typedef struct VectorT
{
NodeT *anchor;
} VectorT;
Code:
void removeElement(VectorT *vector, int index)
{
NodeT *tempR;
tempR=malloc(sizeof(NodeT));
tempR=vector->anchor; // setting temp node to head of list
int i=0;
while(i<index)
{
tempR=tempR->next;
i++;
}
NodeT *tempR2;
tempR2=malloc(sizeof(NodeT));
tempR2=vector->anchor;
i=0;
while(i<(index-1))
{
tempR=tempR->next;
i++;
}
tempR2->next=tempR->next;
tempR->next=NULL;
}