I have to create function with sorts array. I have to give array, lenght of array and direction from low to higher and vica versa. I have to make sorting function by myself, but how can I do that since function cant return array?
Also when I make a new function can I write shortint myfunction(int blah){}?
Will it make any difference?
I dont need to print it, but sort it and give it back to main function
I said nothing about printing.
Tutorial wrote:
At some point, we may need to pass an array to a function as a parameter. In C++, it is not possible to pass the entire block of memory represented by an array represents to a function directly as an argument. But what can be passed instead is its address. In practice, this has almost the same effect, and it is a much faster and more efficient operation.
If a function gets the address of the memory that for the caller is an array, then the function can modify that array of the caller.