linked_list.c

C•Mestre

Explorer

C
Iniciante10
Intermediário10
Avançado10
Especialista5
Mestre5
function_ptr.c
linked_list.c
bit_ops.c
signal.c
mem_pool.c
C++40
C#40
Dart40
Go40
Java40
JavaScript40
Kotlin40
Objective-C40
Perl40
PHP40
Python40
R40
Ruby40
Rust40
Shell40
Swift40
TypeScript40
linked_list.c
Click to focus
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
typedef struct node {↵
   int data;↵
   struct node* next;↵
} node_t;↵
node_t* push(node_t** head, int val) {↵
   node_t* new = malloc(sizeof(node_t));↵
   new->data = val;↵
   new->next = *head;↵
   return *head = new;↵
}↵
void free_all(node_t** head) {↵
   while (*head) {↵
       node_t* tmp = (*head)->next;↵
       free(*head);↵
       *head = tmp;↵
   }↵
}
0WPM•0%•0:00•0/346(0%)|Ln 1, Col 1
UTF-8•C

Exercícios Relacionados