i'm getting an Implicit declaration of function error when i'm running this code. i'm opening a text file containing 365 temperatures and writing them to a 2D array called temps[][]. then i put all the temperatures for january into a 1D array called jan[]. i want to sort all these temperatures in jan[] by using bubble sort, but i'm getting this error when i call the function bubbleUp at the orange line....anybody know why??
#include <fstream.h>
#include <iostream.h>
#include <iomanip.h>
#include <limits.h>
int main()
{
void bubbleSort (int list [ ], int last);
void bubbleUp (int list[ ], int first, int last);
int yearTemps[365];
int jan[31];
int temps[33][14];
int last = 32;
ifstream ins;
ofstream outs;
outs.open("output.txt");
ins.open("FAI1965.txt");
for(int j = 1; j < 32; j++)
{
for(int i = 0; i < 13; i++)
{
if(temps[j][i] == 999)
outs << "***" << " ";
else
outs << temps[j][i] << " ";
}
outs << endl;
}
for(int j = 1; j < 32; j++)
{
for (int i = 0; i < 13; i++)
{
yearTemps[i] = temps[j][i];
}
}
for (int i = 1; i< 32; i++)
{
jan[i] = temps[i][1];
}
bubbleSort (jan, 31);
return 0;
}
void bubbleSort (int list[], int last)
{
int current;
for(current = 0; current < last; current++)
[color=DarkOrange][b]bubbleUp (list, current, last);[/b][/color]
return;
} // bubbleSort
void bubbleUp (int list[ ],
int current,
int last)
{
int walker;
int temp;
for (walker = last; walker > current; walker--)
if (list[ walker ] < list[ walker - 1 ])
{
temp = list[walker];
list[walker] = list[walker - 1];
list[walker - 1] = temp;
} // if
return;
} // bubbleUp