Code:
void foo(void)
{
int b[3]={0};
char c[4]={0x0};
/* this point */
}
I cannot find in the C99 standard - at /* this point */ - what the value of the two initialized auto arrays must be. Section 6.7.8 of the standard does not seem to say. I know what my ANSI compliant compilers produce:
Code:
Breakpoint 1, foo () at foo.c:3
3 int b[3]={0};
(gdb) step
4 char c[4]={0x0};
(gdb) step
5 }
(gdb) print c
$1 = "\000\000\000"
(gdb) print b
$2 = {0, 0, 0}
Any direction or help please? Where does it say 'all elements are set to'?
(c shows only three because of gdb, but the fourth is always zero as well). I've always used
Code:
char whatever[32]={0x0};
on the assumption it was standard.