mhdew

Main function

Mar 3rd, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. typedef struct NODE
  5. {
  6.     int data;
  7.     struct NODE *next;
  8. } node;
  9.  
  10. node *head;
  11.  
  12. int main()
  13. {
  14.     head=(node *)malloc(sizeof(node));
  15.     head->data=3;
  16.     head->next=(node *)malloc(sizeof(node));
  17.     head->next->data=6;
  18.     head->next->next=(node *)malloc(sizeof(node));
  19.     head->next->next->data=2;
  20.     head->next->next->next=(node *)malloc(sizeof(node));
  21.     head->next->next->next->data=7;
  22.     head->next->next->next->next=NULL;
  23.  
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment