Guest User

Untitled

a guest
Oct 20th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. typedef struct _Card
  2. {
  3. char cardValues[2];
  4. char suits;
  5. } Card;
  6.  
  7. typedef struct _Node
  8. {
  9. struct Card *card;
  10. struct Node *next;
  11. } ListNode;
  12.  
  13. ListNode *insertNode(ListNode *prev, Card *data)
  14. {
  15. ListNode *current = prev;
  16.  
  17. while((current->next != NULL) && (compareStruct(prev, data) < 0))
  18. {
  19. prev = prev->next;
  20. }
  21. }
  22.  
  23. int compareStruct(ListNode *node, Card *card)
  24. {
  25. int retVal = 0;
  26.  
  27. if(strcmp(node->next->card->cardValues, card->cardValues) < 0)
  28. retVal = 0;
  29. else
  30. retVal = 1;
  31. return retVal;
  32. }
Add Comment
Please, Sign In to add comment