output the letters of the alphabet with the number of occurrences

hi,
I'm trying to create a program that will read a file and then check the file for each letter of the alphabet and then output the letter and the number of times it appears in the file, into a new file... this is what i have so far but it's not working.. if anyone could help that would be nice!
thanks

#include <iostream>
#include <fstream>
#include <string>
#include <cassert>
#include <cstring>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
cout << "\n To find the number of occurrences of each letter in the alphabet in a specific file,"
<< "enter the file name:";
string inFile;
cin >> inFile;

cout &lt;&lt; "\\nEnter the name of the output file:";
string outFile;
cin &gt;&gt; outFile;

ifstream fin\(inFile.data\(\)\);
assert \(fin.is_open\(\)\);
ofstream fout\(outFile.data\(\)\);
assert \(fout.is_open\(\)\);

vector&lt;int&gt; numoccurrences\(26\);
int i;
char letter;
for\(;;\)
\{
	fin &gt;&gt; letter;
	char lowercase = tolower\(letter\);
	if \('a'&lt;= lowercase &lt;='z'\)
	numoccurrences[ lowercase - 'a']\+\+;
\}
char ch = 0;
for \(int i = 1; i &lt; numoccurrences.size\(\); i\+\+\)
\{
	fout &lt;&lt; ch &lt;&lt; numoccurrences[i];
	ch\+\+;
\}

}

moved to a more appropriate forum - 'High Level Programming'

i really need some help with this.. if anyone has any ideas at all please post

Is this one of those homework questions?

it is for homework, but i dont want people to give me the answer, just a clue about where it's messing up, because i have no clue

I like the use of C++ to make a simple problem more convoluted.

#include <stdio.h>

int main(int argc,char **argv) {
static int occur[256];
int i=' '; 

	while (1) {
		int c=getchar();
		if (c==EOF) break;
		occur[(unsigned char)c]++;
	}

	while (i < 127) {
		if (occur) printf("%c: %d\n",i,occur);
		i++;
	}

	return 0;
}

i'm not really sure what alot of that stuff means.. i'm new to C++... i don't know what arcg and **argv mean.. also is this just for a paragraph of 256 letters? and why do you assign int i = 32? and i also dont know what return 0 does...

Command line arguments are passed to main as argc/argv

No, the array is for the counts of occurances, note they are int, not char. The file is read through stdin and can be any length.

First printable/non-control-code ASCII character

Returns an exit code for the process, so the parent can tell things went okay.

sorry I don't understand any of that.. I don't think i've learned those things yet...

thanks for trying though!

What is the problem with your code? In what form is the manifestation of the issue?

You have no pretty formatting of your results, what is ch supposed to be doing?
I presume the array is supposed to be zero based.

the problem is when i start without debugging, after i've entered the file names, an popup comes up that says debug assertion failed.. vector subscript is out of range

ch is supposed to be counting from 'a' to 'z' and then outputting all the numbers

this is due today so don't worry about trying anymore, but thanks anyways!