Initialization of arrays in C

前端 未结 7 1049
难免孤独
难免孤独 2021-01-21 23:57

In C, I have read that half-initialized arrays will be filled with zeros for the rest of the elements (irrespective of integer or char arrays).

E.g.:

in         


        
7条回答
  •  不思量自难忘°
    2021-01-22 00:26

    It is dependent on the design of the compiler. Normally compilers support it and some may support via some flags during compilation or other options. Some may not support it. It is better to check with the concerned compiler support regd the compatibility with C standard. I think Code Composer Studio IDE(TI DSP processors) support group might give you the exact answer.

    Karthik Balaguru

提交回复
热议问题