First of all, sorry for the profuse code that follows, but I don't want to post too little info. I'm trying to print a linked list that is associated with a binary file. The linked list has only the partid, offset and next pointer.
I can only get my print routine to print the last record...
The following code orders a linked list in ascending order:
while (currentPtr != NULL && value > currentPtr->data) {
previousPtr = currentPtr;
currentPtr = currentPtr->nextPtr;
}
How might I alter this to sort descending?
In the following code, why is the line highlighted in red set to null?
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
struct listNode {
char data;
struct listNode *nextPtr;
};
typedef struct listNode LISTNODE;
typedef LISTNODE *LISTNODEPTR;
void insert(LISTNODEPTR *...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.