i am reading input into an array froman input file. it's reading the numbers but not the right ones. this is my code for filling the array
Code:void fill_arr(float farry[], int *sizearr){ int fills = 0; while (fills < *size && scanf(“%f”, &farry[fills]) !=EOF) fills ++; } *sizearr = fills; }
then i call the add function tha i wrote
and its not doing that correctly. i keep getting zero as the resultCode:float add_arr(float adarry[], int sizearr){ int count; float sum = adarry[0]; for(count = 1; count < sizearr; count++){ sum += adarry[count]; } return sum; }



LinkBack URL
About LinkBacks




