This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Initialization of arrays (newbie)


I've read on the net that a declaration such as

int a[100];

results in all the elements of the array getting initialized to 0.

However, this doesn't appear to be the case with gcc.  I have to use a for
loop and manually set each element to zero.  There must be a better way.
What is it?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]