DSPRelated.com
Forums

array initialization on CCS does not work properly? do u know why?

Started by ahmadagha23 May 11, 2008
Hi;
I am working on C6416 DSK. In my source code I have initialized
global arrays with zero as follows:
array1[900]={0};
array2[6]={0};

But when I see the content of array2, I see that only the first
member is set to zero and other ones are not zero.

Another strong problem is that When I used external Emulator
(TDS510USB from Wintech Co.), the above initialization results in
setting all values of array1 to zero but only first 4 bytes of array2
to zero. When I change the order of array1 and array2 in my source
code it works properly. Is it the bug of compiler or emulator?
How can I set all values of my big arrays?

Regards
Ahmad-

> I am working on C6416 DSK. In my source code I have initialized
> global arrays with zero as follows:
> array1[900]={0};
> array2[6]={0};

The code line:

array2[6] = {0};

is supposed to be integer? Floating-point? Short? Long? What? I don't think people can help you if you can't ask
a precise question.

-Jeff

> But when I see the content of array2, I see that only the first
> member is set to zero and other ones are not zero.
>
> Another strong problem is that When I used external Emulator
> (TDS510USB from Wintech Co.), the above initialization results in
> setting all values of array1 to zero but only first 4 bytes of array2
> to zero. When I change the order of array1 and array2 in my source
> code it works properly. Is it the bug of compiler or emulator?
> How can I set all values of my big arrays?