Code:
void printResults(const int thearray[8])
{
int range[8];
cout<<" RANGE: NUMBER OF STUDENTS:"<<endl;
cout<<" 0 - 24 "<<range[0]<<endl;
cout<<" 25 - 49 "<<range[1]<<endl;
cout<<" 50 - 74 "<<range[2]<<endl;
cout<<" 75 - 99 "<<range[3]<<endl;
cout<<" 100 - 124 "<<range[4]<<endl;
cout<<" 125 - 149 "<<range[5]<<endl;
cout<<" 150 - 174 "<<range[6]<<endl;
cout<<" 175 - 200 "<<range[7]<<endl<<endl;
}//end of function printing results
Your just printing an uninitialized array here. (The fact that you use the same name, doesn't mean range points to the same data in both functions. Here you declare a new array.)
Code:
return range[8];
}//end of function reading data
Here you return an array element which is out of bounds. Luckily you don't try to use it.
The general strategy would be to define an array in main. Pass it to the first function to read data. This function returns nothing, because it modifies the passed array.
Then pass the same array to the second function to print it.