This is what I have so far; I am trying to have an array with probability of all chars and space in a text file, but I have a problem with the data type.
int main()
{
float x[27];
unsigned sum = 0;
struct Count {
    unsigned n;
    void print(unsigned index, unsigned total) {
        char c = (char)index;
        if (isprint(c)) cout << "'" << c << "'";
        else cout << "'\\" << index << "'";
        cout << " occured " << n << "/" << total << " times";
        cout << ", propability is " << (double)n / total << "\n";
    }
    Count() : n() {}
} count[256];
ifstream myfile("C:\\text.txt"); // one \ masks the other
while (!myfile.eof()) {
    char c;
    myfile.get(c);
    if (!myfile) break;
    sum++;
    count[(unsigned char)c].n++;
}
for (unsigned i = 0; i<256; i++)
{
    count[i].print(i, sum);
}
x[0] = count[33];
int j=68;
 for(int i=1;i<27;i++)
 {
     x[i]=count[j];
     j++;
 }
return 0;
}
 
     
     
    