will this work. i nixed some of your functions (for me they're more burdensome than it's worth). while sweets' calc methode is easier to understand, you can still use a function to manipulate the array. don't forget to use code tags next time (and maybe brush up on your english if you want others to understand you )
Code:
#include <iostream.h>
void f_getinput(float array[], int size);
//void, don't return anything, cbelow
int f_mainmenu();
main()
{
int choice, i;
float avg, array[25] = {0};
do
{
choice=f_mainmenu(); //what sweets said
if ( choice == 1 )
{
f_getinput (array, 25);
//i think you need the array size for the call-by-ref
//i couldn't understand what you were doing with that calc stuff,
//will this work? :)
for (i=0; i<25; i++)
{
avg += array[i];
}
avg /= 25;
cout<<"avg is "<<avg<<endl<<"scores are:"<<endl;
for (i=0; i<25; i++)
{
cout<<array[i]<<endl;
}
}
else
break;
}while ( choice !=2 );
}
int f_mainmenu()
{
int x;
cout<<"1-Enter Numbers"<<endl;
cout<<"2-Exit "<<endl;
cin>>x;
return x;
}
void f_getinput(float array[], int y)
{
float num;
int s;
cout<<"if you wish to exit before entering all 25 numbers enter 999"<<endl;
for (s=0;s<y;s++)
{
cin>> num;
if (num == 999)
break;
else
array[s] = num;
//that's all don't return anything,
//in call-by-ref you're changing the actual array
}
}