school

thing1's amazing school repo
Log | Files | Refs | Submodules | README

lltest.c (349B)


      1 #include <stdio.h>
      2 
      3 #include "ll.h"
      4 
      5 int main(){
      6 	ll_t *head = llalloc();
      7 	llsetdata(head, "hello");
      8 
      9 	for (int i = 0; i < 3; i++){
     10 		ll_t *node = llalloc();
     11 		llsetdata(node, "hi");
     12 		llsetnext(head, node);
     13 	}
     14 	for (int i = 0; i < 4; i++)
     15 		printf("%s\n", (char *)llgetat(head, i)); 
     16 	printf("%s\n", llgetendnode(head)->data);
     17 
     18 	llfreeall(head);
     19 }