More getch() woes

Doug Gwyn gwyn at smoke.brl.mil
Wed Mar 27 08:15:36 AEST 1991


In article <19058 at lanl.gov> jlg at cochiti.lanl.gov (Jim Giles) writes:
>   int c[25] = {0};
>This should do what you want in both K&R and ANSI compliant code.

No, that's an attempt to initialize an auto aggregate, which certainly
is not required by the C language described in K&R 1st Edition.

In practically all implementations, memset() would be a nice fast
method of initializing an array of integer type to all zeros.  To
be absolutely safe, you need to use the obvious little loop.



More information about the Comp.lang.c mailing list