Guest User

Untitled

a guest
Mar 18th, 2016
120
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct LIST{
  5.     int value;
  6.     struct LIST *next;
  7. };
  8. LIST *GetTail(LIST *head){
  9.     if(!head)
  10.      return NULL;
  11.     while(head->next != NULL)
  12.      head = head->next;
  13.     return head;
  14. }
  15. void AddEl(LIST *head, int value){
  16.     LIST *newEl = new LIST;
  17.     newEl->value = value;
  18.     newEl->next = NULL;
  19.     if(!head)
  20.      head = newEl;
  21.     else
  22.     {
  23.         head = GetTail(head);
  24.         head->next = newEl;
  25.     }
  26. }
  27.  
  28. int main()
  29. {
  30.     LIST *head = NULL;
  31. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×