this code count the chars of a file.
#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int cont[257]; int t; FILE *ent; for (t=0;t<257;t++) cont[t]=0; ent=fopen("input.txt","r"); // printf("Se abrio el archivo :P\n"); do { t = fgetc(ent); cont[t]++; } while (!feof(ent)); fclose(ent); for (t=0;t<257;t++){ printf("Caracter %i se repitio %i veces\n", t, cont[t]); } // system("PAUSE"); return 0; }