Advertisement
reellearning

Contact Linked List CPP

Jul 23rd, 2012
2,043
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. /*
  2.  * ContactList.cpp
  3.  *
  4.  *  Created on: Jul 23, 2012
  5.  *      Author: Derek
  6.  *
  7.  *      Linked List Example
  8.  */
  9.  
  10.  
  11. #include "ContactList.h"
  12. using namespace std;
  13.  
  14. ContactList::ContactList():head(NULL), size(0)
  15. {}
  16.  
  17.  
  18. void ContactList::addToHead(Contact* newOne)
  19. {
  20.     if(head == NULL)
  21.     {
  22.         head = newOne;
  23.     }
  24.     else
  25.     {
  26.         newOne->next = head;
  27.         head = newOne;
  28.     }
  29.  
  30.     size++;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement