All I want to do at this point is output the letter used most. I can output a-z and how many thimes they are used in an encoded file, but not the single most used letter (which is q) Help please! Anyone!
void initialize (int& lc, int list[], int maxIndex);
void copyText (ifstream& intext, ofstream& outtext, char& ch, int list[]);
void characterCount (char ch, int list []);
void writeTotal(ofstream& outtext, int lc, int list[], int maxIndex);
int indexLargestElement(const int list[], int listSize);
int main ()
{
// Declarations
int shift;
int lineCount;
int letterCount[26];
char ch;
int maxIndex = 0; // string inputFileName;///
ifstream inputFile;
ofstream outputFile;
// Open the input file.
inputFile.open("C:\\Users\\bloo\\Desktop\\Erin\\codetext.txt"); // Need .c_str() to convert a C++ string to a C-style string
// Check the file opened successfully.
if (!inputFile)
{
cout << "Unable to open input file." << endl;
cout << "Press enter to continue...";
return 1;
}
outputFile.open("C:\\Users\\bloo\\Desktop\\Erin\\b.txt");
initialize(lineCount, letterCount, maxIndex);
inputFile.get(ch);
while (inputFile)
{
copyText(inputFile, outputFile, ch, letterCount);
lineCount++;
inputFile.get(ch);
}