summaryrefslogtreecommitdiff
path: root/comp/lucas-standen-NEA/code/ads/ll/lltest.c
blob: 454acdf2de331afbe600dbf75ff0b8a69e0e90f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>

#include "ll.h"

int main(){
	ll_t *head = llalloc();
	llsetdata(head, "hello");

	for (int i = 0; i < 3; i++){
		ll_t *node = llalloc();
		llsetdata(node, "hi");
		llsetnext(head, node);
	}
	for (int i = 0; i < 4; i++)
		printf("%s\n", (char *)llgetat(head, i)); 
	printf("%s\n", llgetendnode(head)->data);

	llfreeall(head);
}