samoz83 0 Newbie Poster

Hey guys,

I've got a small function to work out the lowest number in an array which is loaded from a file and the month names shown below in another array, but I was wondering if I could print everything that is on the same line as the lowest number in the file.

The file is set out as:
Jan 23
Feb 15
Mar 17 etc

and so the lowest month function is meant to display the lowest tempreture (which I can get it to do) but I would also like to show the corrasponding month next to it, is there an easy way of doing this?

This is the lowest month code I have at the moment:

int lowestmonth()
{
	lowest=iTemp[0];

	cout<<"\n\n\tMenu Option... 3 - Lowest Temperature Month(s)........\n"; 

	for(int i=0; i<12;i++)
	{
		if (iTemp[i]<lowest)
		{
			lowest = iTemp[i];
		}
	}

	for (int i2=0; i<12; i2++)
	{
	cout << i2 << ": " << iTemp[i] <<"\n" ;
	}

	cout<<"The Lowest Temperature is "<<lowest<<endl;

	system("pause");

	return 0;
}