Help me in this program.

Write a program that asks the user to enter some text and stores it in a file. The program then opens this file again and counts the number of times each letter appears in the text. An uppercase letter and a lowercase letter are treated as being the same; that is, they are tallied together.
You must make an integer type array of size 26 for the alphabets.

I have made a program which is incomplete right now.

#include <iostream>
#include <fstream>
#include <string>
using namespace std;
//FUNCTIONS
void readtext();
void write();
void read();

//VARIABLES
string line;
int array[26];
char chr,chrlow;
int main()
{
for (int i = 0; i < 26; i++)
array[i] = 0;
readtext();
write();
read();

system("pause>null");
return 0;
}
void readtext()
{
cout << "Enter text: ";
getline(cin, line);
}
void write()
{
ofstream fout("line.txt");
fout << line;
fout.close();
}
void read()
{
ifstream fin("line.txt");
while (fin>>chr)
{
chrlow=tolower(chr);
}
}
Learn to use code tags, then ask a question...
Topic archived. No new replies allowed.