Jirka Klaue wrote:
>
> I wish wrote:
> > #include <string.h>
> >
> > int a[ 100 ];
> >
> > memset( a, 0, sizeof(a) );
> >
> > Does that guarantee all bits zero?
>
> Depends, C90 no, C99 yes.
There's no "depends" about it: under all versions of
the Standard, `a' is set to all bits zero by this code.
What *does* depend on the Standard version is whether
all bits zero is the same as value zero. In C89/90, an
`int' with all bits zero has the value zero. In C99,
where an `int' is permitted to contain bits that are not
part of its value ("padding bits"), it is possible that a
zero-valued `int' might contain non-zero bits, and it
is also possible that an `int' with all bits zero might
be a "trap representation."
--