Analyzer for compression algorithms (or tools)
MAGIC NUMBERS
The number 256 is used in multiple places as an array size. Rather than using the raw number
256, it would be better to use a symbolic constant. Raw numbers in code are sometimes referred to as magic numbers, because it isn't clear what they mean.
There are at least two reasons for this,  


It identifies what the number means.  
If at some point in the future the number has to be changed for all uses, the code only  needs to be changed in one place.


An Example in C:

#define ARRAY_SIZE 256

void stat(char * file, double vector[ARRAY_SIZE])
{
    int c;
    FILE * ftopen = fopen(file, "r");
    while ((c = getc(ftopen)) != EOF)
      {
        if (c &gt;= 0 &amp;&amp; c &lt;= ARRAY_SIZE)
            vector[c]++;
      }

      fclose(ftopen);
}


An Example in C++:

constexpr int ARRAY_SIZE = 256;


Use Meaningful Variable and Function Names
The code contains foo and bar in a number of places. These are not meaningful names.
The names should indicate what the variables are, so that if you or someone else needs
to change the code 2 years in the future it is an easy task rather than having to go
through all the code to see what needs to be changed.

Another exmaple of this is the function ccount(), which could be renamed file_size().

A third example is the array vector. Other than array if doubles it is not clear what
this array is used for.

Inconsistent Coding Style
In a professional setting where multiple people may have to maintain the code it is best
to be as consistent as possible.

The else clauses almost always have { block}` but the if statements do not.
This is true whether or not the block contains multiple statement or not.
You should choose one way or the other.

In the for loops the { is immediately under the for, but in the else clauses it
is indented. Choose one or the other. The most common usage is how you do the for loops.

This is partially a matter of choice, I use { block } on all control statements:

if ()
{
}
else
{
}

for ()
{
}

while ()
{
}

do
{
} while ();


I do this even for single statements because if the code needs to be updated by adding a statement
to a block it is easier for anyone to see where the line of code should be inserted. This was
also required as part of a coding standard at a company where I worked.

Empty Clauses in IF/ELSE
In the function shannon() the code contains:

    if (vector[i] == 0.0)
      continue;
    else
      {
        shan = shan + (log2(pow(vector[i], vector[i])));
      }


This would be clearer if it was written

    if (vector[i] != 0.0)
      {
        shan = shan + (log2(pow(vector[i], vector[i])));
      }


An else clause can be added at a later time if it is needed. The if portion of the current
implementation is meaningless and would be optimized out by the compiler.