Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include "stdafx.h"
- #include "List.h"
- typedef struct List_Node
- {
- LIST_ENTRY list;
- int val1;
- }LIST_NODE, *PLIST_NODE;
- int _tmain(int argc, _TCHAR* argv[])
- {
- int i = 0;
- PLIST_NODE pNewnode;
- pNewnode = new LIST_NODE;
- LIST_ENTRY head;
- InitializeListHead(&head);
- for (i = 0; i < 3; i++)
- {
- pNewnode = new LIST_NODE;
- pNewnode->val1 = i;
- InsertTailList(&head, &pNewnode->list);
- pNewnode = NULL;
- }
- while (!IsListEmpty(&head))
- {
- PLIST_ENTRY removeNode = RemoveHeadList(&head);
- PLIST_NODE mydatanode = (PLIST_NODE)CONTAINING_RECORD
- (removeNode,LIST_NODE,val1);
- printf("%dn", mydatanode->val1);
- }
- return 0;
- }
- PLIST_ENTRY removeNode = RemoveHeadList(&head);
- PLIST_NODE mydatanode = (PLIST_NODE)CONTAINING_RECORD(removeNode,LIST_NODE,val1);
- PLIST_ENTRY removeNode = RemoveHeadList(&head);
- PLIST_NODE mydatanode = (PLIST_NODE)CONTAINING_RECORD(removeNode,LIST_NODE,list);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement