Thread: array issue
View Single Post
Old Apr 30th, 2008, 12:24 AM   #3
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 816
Rep Power: 4 The Dark is on a distinguished road
Re: array issue

In your Fill_Array function, you don't set the number_used variable to the number of items found.

In your print_array function:
void Print_Array(int Size[], int count)
{
	int number_used = 0;
	for(int index = 0; index < number_used; index++)
		cout << Size[index] << " ";
}
You should use the count that is passed in, rather than the number_used variable that is set to 0

The Calc_Average and Calc_Median functions need to be passed the number of items in the array, rather than using MAX_SIZE

Also, your array is of type int, and the input has floating point numbers, you should look into using type double.
The Dark is offline   Reply With Quote