I am right now reading in like this:
while (fscanf(in, "%c", infile) != EOF)
{
ch = *infile;
count++;
ascii[ch]++;
}
And making my frequency table like this:
void frequency ()
{
unsigned long long i;
for (i = 0; i < 255; i++)
{
if (ascii[i] != 0)
{
uniqueLetters++;
if (i < 33)
{
printf("=%llu\t%lu\n", i, ascii[i]);
}
else if (i > 126)
{
printf("=%llu\t%lu\n", i, ascii[i]);
}
else printf("%c\t%lu\n", (int)(i), ascii[i]);
}
}
printf("unique letters: %lu\n", uniqueLetters);
}
(This is for a huffman encoding project and when I try to read in an entire file I completely miss anything above 126...)