1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int i, l;
FILE *src = NULL;
FILE *f = NULL;
int size[12];
int taille;
char* mot;
char* tab[12];
src = fopen ("huffman_DC.txt", "r");
f = fopen("test.txt", "w");
if((src == NULL) || (f == NULL))
{
printf("pb ouverture fichier\n");
}
for (i=0;i<12;i++)
{
fscanf(src,"%d %s", &taille, mot);
fprintf(f, "%s", mot);
size[i] = taille;
tab[i] = mot;
printf("voila le mot de code %d %s \n", i, tab[i]);
}
printf("voila tab mot %s \n", tab[4]);
fclose(src);
fclose(f); |