将数组的整体赋值改成直接赋值的形式
请教一个问题,我想讲下列数组改成直接赋值的形式,应该怎么改??int (*fenc_mvs[2])[2] = { &frames[b]->lowres_mvs[0][b-p0-1][i_mb_xy], &frames[b]->lowres_mvs[1][p1-b-1][i_mb_xy] };
要求是这样的,举个例子说明:
int a[3]={3,4,5};
改成:
int a[];
a[0]=3;
a[1]=4;
a[2]=5;
#include <stdio.h> #define MAX_X_DIMENSION 10 #define MAX_Y_DIMENSION 10 #define MAX_Z_DIMENSION 10 #define MAX_FRAMES 5 typedef struct __Frame { int lowres_mvs[MAX_X_DIMENSION][MAX_Y_DIMENSION][MAX_Z_DIMENSION]; }Frame; Frame frames[MAX_FRAMES]; static int b = 0; static int p0 = 1; static int p1 = 1; static int i_mb_xy = 0; int main(int argc, char *argv[]) { int (*fenc_mvs[2])[2]; fenc_mvs[0] = (int(*)[2])&(&frames[b])->lowres_mvs[0][b-p0-1][i_mb_xy]; fenc_mvs[1] = (int(*)[2])&(&frames[b])->lowres_mvs[0][b-p0-1][i_mb_xy]; return 0; }我想你的代码可能是这个意思