Hi,
i don't get why the following code crashes, please help!
makefifo is supposed to create a fifo-stack with "amount" bytes, through a pointer to "newfifo"...Code:#include <stdlib.h> #include <stdio.h> struct fifos { int *buf, in_cur; }; typedef struct fifos fifo; void makefifo( fifo *fif, int amount ) { fif->buf = ( int* )malloc( amount ); fif->in_cur = 0; } main() { fifo *newfifo; makefifo( newfifo, 200 ); }