view Huffman/test-huffman.c @ 14:43cfb6cbf809 draft

add Huffman
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 31 Jul 2012 04:15:35 +0900
parents
children 2ec14e6d8303
line wrap: on
line source

#include <stdio.h>
#include <stdlib.h>





#define BUF 1024


int main(int argc, char* argv[]) {
	
	FILE *fp;
	char *filename = "./test.txt";
	if ( (fp = fopen( filename,"r")) == NULL ) {
		fprintf(stderr, "can't open file %s\n", filename);
		exit(0);
	}
	char c;
	while (c = getc(fp)) {
		if (feof(fp)) {
			break;
		}

		putc(c,stdout);

	}




	fclose(fp);
	return 0;
}