| delorie.com/archives/browse.cgi | search |
| From: | ovek AT arcticnet DOT no (Ove Kaaven) |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: boo hoo. my code crashes. |
| Date: | Mon, 17 Feb 1997 02:31:17 GMT |
| Organization: | Vplan Programvare AS |
| Lines: | 19 |
| Message-ID: | <5ecmk3$esk$2@troll.powertech.no> |
| References: | <5e5d6n$fda AT flex DOT uunet DOT pipex DOT com> |
| NNTP-Posting-Host: | alwayscold.darkness.arcticnet.no |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
nikki AT gameboutique DOT co (nikki) wrote:
>int huffman_encode ()
>{
> struct node *histogram[NUM_SYMBOL_VALUES];
> struct node *huffman_tree;
> int encoded_stream_length;
> unsigned int i;
>printf("a\n");
> /* initialize histogram */
> for (i=0; i<NUM_SYMBOL_VALUES; i++) histogram[i]= (struct node *) NULL;
>printf("b\n");
>}
"histogram" is a pointer to struct node, but does it point anywhere?
I would recommend a malloc() call before writing into void:
histogram=malloc(sizeof etc etc);
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |