Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct LIST{
- int value;
- struct LIST *next;
- };
- LIST *GetTail(LIST *head){
- if(!head)
- return NULL;
- while(head->next != NULL)
- head = head->next;
- return head;
- }
- void AddEl(LIST *head, int value){
- LIST *newEl = new LIST;
- newEl->value = value;
- newEl->next = NULL;
- if(!head)
- head = newEl;
- else
- {
- head = GetTail(head);
- head->next = newEl;
- }
- }
- int main()
- {
- LIST *head = NULL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement