0
How to define a function with array output as well as array inputs?
Just write a tiny function to help me understand. Thanks.
3 Respostas
0
Please be a bit more specific.
0
You can't return an array. You can only return a pointer to an array. So:
int *f(int a[], int b[]);
0
Just create a function that takes an array and return another array, suppose you have to modify it or sort it
Eg.
int *sort(int *arr, int size) {
// Some code here
}
Edit : however, when using an array in a function, the data of the array one modified will be permanent.