class//
public:
double a[3][2][2];
void f(double b[3][2][2]){
//How do i assign b to a?
}
我如何分配arrays.I卡住我的指針多維數組分配
class//
public:
double a[3][2][2];
void f(double b[3][2][2]){
//How do i assign b to a?
}
我如何分配arrays.I卡住我的指針多維數組分配
甲memcpy的就可以了:
memcpy(a, b, sizeof(a));
注意不要用sizeof(b)
,由於B實際上是一個指針,而不是一個數組,所以只有4或8個字節將被複制。
感謝您的答案 – feminkk 2012-07-24 18:45:20