hi all,
i am having kinda difficulty with pointers in C.
if i have a program where i would have a linked list and each node contains some specific info. for example, i want to get 3 consecutive nodes, which would have LOADC, LOADC and ADD , respectively in each node, so first to find them. i would do

instruction * instr, *temp; <-- instr is already pointing to the list.
temp = insr ; <-- temp will travers thru the list
while (temp!=null){

if(temp->opcode == LOADC){ //opcode is fieldtype in the code
int x = field 1;
temp = temp->next;
if(temp->opcode ==LOADC) //2ndnode
int y = field1;
temp = temp->next;
if(temp->opcode == ADD)//3rd node
int z = x + y;
}
temp = temp->next;
}



but i dont know how would i delete the 2nd and 3rd node and set the pointer back at the first node.

i would really appreciate it if someone would help me out with this.
thanks a lot again.