var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: In desperate need of help!!
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.
int calcFreq(int Ratings, int Freq, int NumStudents);
Freq = calcFreq(Ratings, Freq, NumStudents);
Thanks for any help you can provide!
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;
You have a small error
Your function calcFreq does not return an array, I recommend you to return a 0 or -1 to indicate error/success instead of trying to return an array:
return Freq; /* this is wrong */
return 0; /* this is wright */
return i; /* this is wright */