Upload New File
This commit is contained in:
parent
6f550fa9bf
commit
00d25de4d9
59
chained_list.c
Normal file
59
chained_list.c
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
============================================================================
|
||||||
|
Name : chained_list.c
|
||||||
|
Author : Lukas Heiligenbrunner
|
||||||
|
Version : 0.1.5 BETA
|
||||||
|
Copyright : My copyright
|
||||||
|
Description : C programme to manage chained lists
|
||||||
|
============================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "chained_functions.h"
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
|
||||||
|
messdaten * head;
|
||||||
|
messdaten * erste;
|
||||||
|
messdaten * zweite;
|
||||||
|
messdaten * dritte;
|
||||||
|
dr
|
||||||
|
|
||||||
|
head = malloc (sizeof(messdaten));
|
||||||
|
erste = malloc (sizeof(messdaten));
|
||||||
|
zweite = malloc (sizeof(messdaten));
|
||||||
|
dritte = malloc (sizeof(messdaten));
|
||||||
|
if (head == NULL || erste == NULL || zweite == NULL || dritte == NULL)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
insertLast (head, dritte);
|
||||||
|
insertPos (head, erste, 1);
|
||||||
|
insertPos (head, zweite, 2);
|
||||||
|
|
||||||
|
erste->messwert = 1;
|
||||||
|
zweite->messwert = 2;
|
||||||
|
dritte->messwert = 3;
|
||||||
|
head->messwert = 42;
|
||||||
|
|
||||||
|
printf ("Messwert von head: >%f<\n", head->messwert);
|
||||||
|
printf ("Messwert von head next: >%f<\n", head->next->messwert);
|
||||||
|
printf ("Messwert von head next next: >%f<\n", head->next->next->messwert);
|
||||||
|
printf ("Messwert von head next next: >%f<\n\n",
|
||||||
|
head->next->next->next->messwert);
|
||||||
|
|
||||||
|
printf ("Messwert von head >%f<\n", head->messwert);
|
||||||
|
printf ("Messwert von erste: >%f<\n", erste->messwert);
|
||||||
|
printf ("Messwert von zweite: >%f<\n", zweite->messwert);
|
||||||
|
printf ("Messwert von zweite: >%f<\n", dritte->messwert);
|
||||||
|
|
||||||
|
deleteLast (head);
|
||||||
|
deleteLast (head);
|
||||||
|
deleteLast (head);
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user