使用labview生成DLL在C++中调用,生成的.h文件中数组结构体怎么理解

使用labview生成DLL在C++中调用,生成的.h文件中数组结构体怎么理解。

typedef struct {
int32_t dimSizes[2];
double Numeric[1];
} DoubleArrayBase;
**typedef DoubleArrayBase DoubleArray;
typedef struct {
int32_t dimSize;
double elt[1];
} DoubleArray1Base;
typedef DoubleArray1Base **DoubleArray1;
typedef struct {
DoubleArray1 Amplitudes;
} Cluster;
typedef struct {
int32_t dimSize;
Cluster Locations[1];
} ClusterArrayBase;
typedef ClusterArrayBase **ClusterArray;
typedef struct {
DoubleArray1 _2ndDerivatives;
} Cluster1;
typedef struct {
int32_t dimSize;
Cluster1 Locations[1];
} Cluster1ArrayBase;
typedef Cluster1ArrayBase **Cluster1Array;

/*!

  • FindPeak
  • /
    void __cdecl FindPeak(*DoubleArray Array, double threshold,
    uint16_t peaksValleys, int32_t width, int32_t found[],
    ClusterArray *Amplitudes, Cluster1Array *_2ndDerivatives, int32_t len);

其中,FindPeak函数中在VI中定义的输入数组是二维数组,但labview生成.h文件中二维数组的格式是结构体DoubleArray *Array,完全不知道咋用了

运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果

仅供参考:

#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
int **newarr2d(int rows,int cols) {
    int **p,i;

    p=(int **)malloc(rows*sizeof(int *));
    if (NULL==p) exit(1);
    for (i=0;i<rows;i++) {
        p[i]=(int *)malloc(cols*sizeof(int));
        if (NULL==p[i]) exit(1);
    }
    return p;
}
void deletearr2d(int **p,int rows) {
    int i;

    for (i=0;i<rows;i++) {
        free(p[i]);
    }
    free(p);
}
int main() {
    int **arr2d,i,j,r,c;

    r=4;
    c=5;
    //在堆中开辟一个4×5的二维int数组
    arr2d=newarr2d(r,c);
    for (i=0;i<r;i++) {
        for (j=0;j<c;j++) {
            arr2d[i][j]=i*c+j;
        }
    }
    for (i=0;i<r;i++) {
        for (j=0;j<c;j++) {
            printf(" %2d",arr2d[i][j]);
        }
        printf("\n");
    }
    deletearr2d(arr2d,r);

    r=6;
    c=3;
    //在堆中开辟一个6×3的二维int数组
    arr2d=newarr2d(r,c);
    for (i=0;i<r;i++) {
        for (j=0;j<c;j++) {
            arr2d[i][j]=i*c+j;
        }
    }
    for (i=0;i<r;i++) {
        for (j=0;j<c;j++) {
            printf(" %2d",arr2d[i][j]);
        }
        printf("\n");
    }
    deletearr2d(arr2d,r);

    return 0;
}
//  0  1  2  3  4
//  5  6  7  8  9
// 10 11 12 13 14
// 15 16 17 18 19
//  0  1  2
//  3  4  5
//  6  7  8
//  9 10 11
// 12 13 14
// 15 16 17
//


你可以参考下这篇文章:Labview调用C++ dll之字符串数组传递