I i am just studying modulization in C. Now im a bit confused.
What i want to do is the user inputs 10 numbers and they are stored in an array. Then the numbers are each passed to a module (procedure) to determine if its the maximum value. How would i go about the modules?
Below i created a brief try, ignoring the like syntax errors, is this how i could pass the array to another module etc?
Thanks
Code:int main(int argc, char ** argv) { int i; float array[i]; for(i=0;i<10;i++) { fprintf(output,"Please enter your values"); fscanf(input,"%f",&array[i]); maximum_num(array[i]); } fprintf(output,"Maximum number is %f\n",&maximum_num); } int maximum_num(float array_size); { float current_max = 0; if(array[i]>current_max) return current_max = array[i]; }



LinkBack URL
About LinkBacks



