Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dPtr1 = dList->front->forw; //tracks the DLN we are building the SLL for
- dPtr2 = dList->front->forw; //tracks the location of the desired DLN data
- while(i<count)
- {
- sPtr = NULL;
- printf("%d\n", i);
- j=0;
- while(j<count) //build SLL
- {
- fscanf(fptr, "%d", price);
- printf("\t%02d price: %d\n", j, price);
- if(price != 0)
- {
- if(sPtr == NULL)
- {
- sPtr = (SNODE*)malloc(sizeof(SNODE));
- sPtr->data = &dPtr2->data;
- sPtr->price = price;
- dPtr1->link = sPtr;
- dPtr1->destinations++;
- }
- else
- {
- sPtr->link = (SNODE*)malloc(sizeof(SNODE));
- sPtr = sPtr->link;
- sPtr->data = &dPtr2->data;
- sPtr->price = price;
- dPtr1->destinations++;
- }
- }
- dPtr2 = dPtr2->forw;
- j++;
- }
- printf("destinations: %d\n", dPtr1->destinations);
- dPtr1 = dPtr1->forw;
- i++;
- }
Add Comment
Please, Sign In to add comment