0

I made a function in c++ that I named it apply_morph_find_target_func.
In this function I want to get two values and return one Mat and one dynamic array.
The name of the dynamic array is target_property.
The size of target_property would be n*6, where n is dynamic:
target_property Here is what I have defined for my function :

Mat apply_morph_find_target_func(Mat result_first, Mat im) {
  ...
}

what should I do? regards

Federico Grandi
  • 6,785
  • 5
  • 30
  • 50

1 Answers1

1

You can return a structure with mat and a pointer to array within the structure. And in the main function to excess this values.

struct MyStruct{
    int **mat;
    int *arr;
};

MyStruct foo(){
    int n=1;
    MyStruct fooz;
    fooz.mat=new int*[n*6];
    fooz.arr=new int[6];
    return fooz;
}
DavidWeiss2
  • 426
  • 2
  • 7