Hello,
I had the same problem a while ago, as far as I remember I used new[] to
get it working.
For example you could use something like that:
float (*coeftemp1)[512] = new float[1024][512]; //not sure if this
actually works
or you can use a one dimensional array:
float *coeftemp1 = new float[1024*512];
and acces it the following way
float z; //just for testing
for (int x=0; x<1024; x++){
for (int y=0; y<512; y++){
z=coeftemp1[x*y]; //that way it should work
}
}
Of course if you don't use c++ you can use malloc. I hope this work, but
I didn't test it.
Regards,
Christoph
Hi, There wrote:
> Hi, There,
>
> I want to declare a two-dimension array by
> "float coeftemp1 [1024][512];". It doesn't work.
>
> But, if I change it to "float coeftemp1 [1024][500];".
> It works. Could any one know the reason?
>
> Thank you,
>
>
>
>
> //**************************
> #include <cstdlib>
> #include <iostream>
>
> using namespace std;
>
> int main(int argc, char *argv[])
> {
> float coeftemp1 [1024][512];
> system("PAUSE");
> return EXIT_SUCCESS;
> }
> //**************************
>
|