Hey guys, this is my first time posting here, but I've used the forums to find help before
I'm in a jam, my final C program is due and I still can't get it to work.
I'm trying to return an int array from a function to the main for use in other functions, but it won't let me return it.
Function Declaration:
Quote:
|
int calcFreq(int Ratings[], int Freq[], int NumStudents);
|
Function Call:
Quote:
|
Freq[] = calcFreq(Ratings, Freq, NumStudents);
|
Function Body:
Quote:
int calcFreq(int Ratings[], int Freq[], int NumStudents)
{
int i = 0;
for (i = 0; i < NumStudents; i++)
{
Freq[Ratings[i]-1] = Freq[Ratings[i]-1] + 1;
}
return Freq[];
}
|
Thanks for any help you can provide!