I am trying to get my 'findMax' function to work, but I am not sure what to name the first part of my parameter list. I know what I have done is wrong because I keep getting the red lines under my code in the function call, but I don't know what to change it to. The comments are just part of my old code in which I could get the output needed without using the 'findMax' function. Any insight would be appreciated. Code is below:
[code]
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
ifstream fin;
fin.open("merch.txt"); //opens file that data will come from
ofstream fout;
fout.open("salesresults.txt"); //opens files where data will be sent
int z=0;
float totalSales = 0;
//float maxTotalsales = 0; // Set max total sales to zero, and assign it a value once it needs one
//int maxTotalsalesIndex=0;
int maxShirtsSold=0;
int maxShirtsIndex=0;
//int maxPostersSold=0;
//int maxPostersIndex=0;
while (fin>>A[z])
{
totalSales = A[z].shirtsNum*A[z].shirtsPrice+A[z].postersNum*A[z].postersPrice+A[z].recordsNum*A[z].recordsPrice;
/*fout<<"The max total sales is "<<maxTotalsales<<" for "<<A[maxTotalsalesIndex].venue<<"."<<endl;
fout<<"The max shirts sold is "<<maxShirtsSold<<" in "<<A[maxShirtsIndex].venue<<"."<<endl;
fout<<"The max posters sold is "<<maxPostersSold<<" in "<<A[maxPostersIndex].venue<<"."<<endl;
fin.close();
fout.close();
*/