![]() ![]() ![]() | structures/lists.c - Et eksempel på en liste af punkter håndteret i funktionen main. | Lektion 12 - slide 26 : 36 Program 2 |
int main(void) { cons_cell *points; point p1 = {1,2}, p2 = {3,4}, p3 = {5,6}; points = cons(&p1, cons(&p2, cons(&p3, NULL))); while (points != NULL) { prnt_point(*((point*)(head(points)))); points = tail(points); } return 0; }