new c++ user that needs help

I'm in a programming class and I have an assignment where I have to open a file, and count the number of times a certain character apperas that the user input, in that file. I need help in figuring out how to create a function to count the number of occurence of a give characeter, and with any mistakes that I may have made. So far this is what I have

#include "stdafx.h"
#include <iostream>
using namespace std;

// function to find the number of occurences of a character
int count_file(ifstream& in_file, int num);
int count_file(in_stream, out_stream);
int main()
{
int num, total;

//open file input
in_stream.open\("infile.txt"\);
if \(in_stream.fail\(\)\)
\{
	cout &lt;&lt; "opening input file failed" &lt;&lt; endl
		&lt;&lt; "program terminated" &lt;&lt; endl;
	exit\(1\);
\}

cout &lt;&lt; "Enter a charcter that you would like to know whether or not it appears";
cin &gt;&gt; num;


// function to find the number of occurences of a character
count_file\(\)

//open file for output
out_stream.open\("outfile.txt"\);

count\_file\(in_stream, out_stream\);

// closing files
in_stream.close\(\);
out_stream.close\(\);

return 0;

}

int count_file(ifstream& in_file, int num)
{
while(! in_file.eof())
{
fin.get(num)
total =
}
}

// function to output the answer
int count\_file\(in_stream, out_stream\)
\{
	cout &lt;&lt; "The charcetr" &lt;&lt; num &lt;&lt; "occured" &lt;&lt; total &lt;&lt; "times";
\}

http://www.unix.com/unix-dummies-questions-answers/2971-simple-rules-unix-com-forums.html

Rule 6.

surely you would do the equivalent of

int count_file(FILE *fpIn,char whatToLookFor)
{
         int result=0;
         int c;

         while (EOF!=(c=fgetc(fpInf)))
         {
               if (c==whatToLookFor) result++;
         }

         return result;
}

But you're in a C++ class so you do it in C++.

I think you mean "whether", not "weather".

thankyou for the help