Hi, I am having trouble with a C++ problem for school. Im writing a program that takes input for the highest and lowest temperatures of each month, and stores them in a 2 dimensional array. I then wrote 2 fuctions to find the average high and low temps. Part of my program is to write a function. Those work fine but the problem then goes on to state that I need 2 functions that returns the INDEX of the high and low temps. Im using my colleges "dos style" environment to program in and it does not let me copy and paste outside of that program but here is what im thinking for the first function:
int indexHighTemp(int YrTemp [12][2])
{
int highTempIndex; //place were I will store the index position
int x;
int highTemp; //place where i will store the high temp
highTemp = 0;
for(x = 0; x < 12; x++)
{
if(highTemp >= YrTemp[x][0])
highTemp = YrTemp[x][0];
}
cout << highTempIndex << endl;
}
//I think this function will give me the high temperature but I dont know about the index.
If anyon could help me out a little, i would greatly appreciate it :)