Skip to content

Commit

Permalink
Add linked list example (not yet working)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecb committed Sep 29, 2023
1 parent b949614 commit 459d692
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ncc/examples/linkedlist.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <assert.h>
#include <string.h>
#include <stdlib.h>

// Linked-list node
typedef struct {
int v;
node_t* next;
} node_t;

int main()
{
// FIXME: this doesn't quite work yet
/*
node_t* list = NULL;
for (int i = 0; i < 10; ++i)
{
node_t* new_node = (node_t*)malloc(sizeof(node_t));
}
*/

return 0;
}

0 comments on commit 459d692

Please sign in to comment.