How can i return an array from function in c++..
I have this code:
#include <iostream>
#include <string>
using namespace std;
int ordincreasente(int num[], int len){
int curMax,curMin,ordinato[len];
for(int i=0; i<(len-1); i++){
for(int j=i+1; j<len; j++){
if(num[i]<num[j]){
swap(num[i], num[j]);
}
}//end second loop
}//end first loop
for(int i = 0; i<len;i++){
cout<<num[i]<<" ";
}
cout<<endl;
}
int main() {
ordincreasente(arr,b);
cout<<endl;
return 0;
}