我在我的類中使用了一個3d維度tfpairexp作爲輸入參數的方法。我需要稍後使用tfpairexp中的值。將多維數組傳遞給函數
void calctfpairexp (int tf1, int tf2, double tfpairexp[][2][3])
{
int ctr,c;
for (int j = 0; j < cchips && (c = chips[j].crepls); j += c)
{
int ctrl_no=0;
for (int *p = chips[j].ctrl ; p && (ctr=*p)>=0; ++p,ctrl_no++) {
for (int k = 0; k < c; ++k)
{
tfpairexp[j][ctrl_no][k]=interactionFunc(2,3,1);
}
}
}
}
我調用類中的方法是這樣的: calctfpairexp(tf1,tf2,tfpairexp);
,我需要在接下來的幾行裏面使用tfpairexp值。 但是編譯器給在這一行錯誤:
`calctfpairexp(tf1,tf2,tfpairexp);`
它說,它無法找到calctfpairexp適當的合適的功能可按。任何想法?
你有沒有考慮過使用'boost :: multi_array'這樣的類? – Philipp
嗨。我應該如何使用它? – Pegah