Advertisement
galahad231

huff.c

Jan 21st, 2020
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. void print_bit(queue *queue, ht *hash, long int h){
  2.  
  3.             printf("%ld: ", h);
  4.             node *current = hash->table[h]->fila->front;
  5.             while(current != NULL){
  6.                 printf("%d->", current->data);
  7.                 current = current->next;
  8.             }
  9.             printf("NULL\n");
  10. }
  11. void compress(FILE *file, ht *hash, queue *fila){
  12.     unsigned char element;
  13.     while(1){
  14.         element = fgetc(file);
  15.         element = (long int)element;
  16.         print_bit(fila, hash, element);
  17.         if(feof(file)){
  18.             break;
  19.         }
  20.     }
  21. }
  22. compress(file, hash_table, queue);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement