1) Start at head to get address of first node -- nodeA
2) Get address of next node -- NodeB.
3) Delete nodeA
4) Move nodeB into nodeA
5) Loop back to 2
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
Nope. You only have step 5.
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
I probably misinterpreted what you typed, but I think I have until step 3 I just wasn't specific:
void deleteAllStructs(void){
struct CarInfo *erasingPtr;
do {
erasingPtr=gHead->next;
gHead=NULL;
} while (NULL!=gTail);
}
Point to the line that accomplished step 1:
1) Start at head to get address of first node -- nodeA
Point to the line that accomplished step 2:
2) Get address of next node -- NodeB.
Point to the line that accomplished step 3:
3) Delete nodeA
Point to the line that accomplished step 4:
4) Move nodeB into nodeA
Point to the line that accomplished step 5:
5) Loop back to 2
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944