#include <stdio.h>
#include <stdlib.h>
typedef struct STRUCT_WOERTERBUCH
{
unsigned int uiLZW_Code;
struct STRUCT_WOERTERBUCH *tWeiterer_Eintrag;
} STRUCT_WOERTERBUCH;
void Einfuegen (STRUCT_WOERTERBUCH **tWoerterbuch);
void Free (STRUCT_WOERTERBUCH **taWoerterbuch);
int main()
{
STRUCT_WOERTERBUCH **taWoerterbuch;
taWoerterbuch = calloc (10,sizeof*taWoerterbuch);
printf("taWoerterbuch[5] vorher:%p\n",(void*)taWoerterbuch[5]);
Einfuegen(taWoerterbuch+5);
printf("taWoerterbuch[5] nachher:%p\n",(void*)taWoerterbuch[5]);
printf ("taWoerterbuch[5]->uiLZW_Code:%u\n",taWoerterbuch[5]->uiLZW_Code);
Free(taWoerterbuch);
return 0;
}
void
Einfuegen(STRUCT_WOERTERBUCH **tWoerterbuch)
{
*tWoerterbuch = malloc(sizeof**tWoerterbuch);
(*tWoerterbuch)->uiLZW_Code = 10;
}
void Free (STRUCT_WOERTERBUCH **taWoerterbuch)
{
long lCounter1 = 0;
for (lCounter1 = 0; lCounter1 < 10; lCounter1++) free(taWoerterbuch[lCounter1]);
free(taWoerterbuch);
}