Because this is a common error message, I've Googled the issue. Unfortunately, all I could find were threads wherein the issue arose from global and local variables having the same name. My problem has nothing to do with global variables, so I believe this constitutes a new question. C won't let me call a function. Every time I call a function like so
...
adjusted_scores = *new_scores(scores,days_late,penalty);
numeric_score = final_score(adjusted_scores, weights);
...
, with supporting code
int * new_scores(int scores[], int days_late[], int penalty) {
int new_scores[MAX_ASSIGNMENTS];
/*computes size of array*/
int size = sizeof(scores)/sizeof(scores[0]);
int i;
for(i=0;i<size;i++){
new_scores[i]=scores[i]-penalty*days_late[i];
}
return new_scores;
}
for the function in question if that helps, I get the message
error: incompatible types when assigning to type 'int[50]' from type 'int'.
Earlier, I had gotten the message
error: called object 'new_scores' is not a function,
so the error message has become longer and the situation has not improved. On top of that, I have been consistently been warned via the message
warning: function returns address of local variable [enabled by default],
so even if I got the errors to vanish, the program would probably mess up in a different way when it came time to actually run the code. Best case scenario is that the code successfully compiles, but whatever the function returns cannot be accessed.
Disclaimer: For unexplained reasons, malloc, memcpy, and any tools related to dynamic memory allocation must not be used to fix the problem. I will try to figure what those reasons are if the disclaimer becomes too much of a burden to deal with.