Advertisement
Guest User

derzhi lolka

a guest
Feb 27th, 2021
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. struct List * newList(int n, int initialValue)
  2. {
  3.     struct List *head; /*after: head = randomnaya yoban'*/
  4.     struct List *current = head; /*after: current = randomnaya eban'*/
  5.  
  6.     for (int i = 0; i < n; i++)
  7.     {
  8.         current = (struct List*)malloc(sizeof(struct List));
  9.         current->index = i;
  10.         current->value = initialValue;
  11.         current = current->nextNode;
  12.     }
  13.     current = NULL;
  14.     return head; /*return head = randomnaya eban'*/
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement