problems with IFSTREAM and Void Functions

I need to read from a file that contains names and grade, then use the grades to find the average and letter grade.

I know i need to first declare the void functions before void main() but i have seen our teach do things such as:
1
2
3
4
5
6
using namespace std
void sum(&int, blahblah)
void avg(&int, blahblah)
void main()
{
  


and then continue. My problem is i cant figure out 1: what the "(&int, blahblah) is. I'm assuming its pass by refrence but i could be wrong. Even if that is right, im not exactly sure what that means.

another question is, do i have to create a variable for each grade for each student and declare them? or am i supposed to use a loop? If i am to use a loop, how do i do it. My book is not very helpful. It is Starting out with C++ early objects sixth edition by tony gaddis, Judy Walters and Godfrey Muganda

any help is greatly appericiated


so far all i have is:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>

using namespace std;

void sum
void average
void letter_grade

void main()

{
	ifstream input;
	ofstream output;

Last edited on
Topic archived. No new replies allowed.