Home > Back-end > Small white for help (about a custom function)
Small white for help (about a custom function)
Time:11-28
C language in the homework problems: Write a program to the user to enter the five integers, procedures in the order since the childhood to print user input five integers, two functions to define and statements in the program, The first function is the minimum value, there are three parameters, the first parameter is the one dimension array, the second parameter is the beginning of the array subscript values, the third argument to the length of the array, the second parameter is used, in the call for the minimum function, not every need from 0 subscript, namely can again when given an array in the function of the minimum range, The second function is sorting function that requires two parameters, the first parameter is the one dimension array, the second parameter is the array length, In the second function call the first function, c The main function is used to handle user input and call sort function (the second) and print the results,
As shown above, I've defined a [5], I and n global variables, and then run the results for "Segmentation fault (core dumped)" Want to ask you how great god can adjust in the case of without the use of Pointers to achieve the effect of homework required? (or is a problem in the custom function?)
CodePudding user response:
When sort function call and there is a problem, is the same as the min function;
In addition, the sort function in dealing with cross-border,