blargg.h4g
9/25/2008 10:19:00 PM
In article
<965527ed-e0c5-493d-83fc-f8efde6a3df0@73g2000hsx.googlegroups.com>,
auspicious <auspicious.me@gmail.com> wrote:
> I would like to know what does the standard say about initialization
> of local static variable's default initialization.
>
> void f(int a)
> {
> static int b;
> b+=a;
> }
>
> Shall 'b' be initialized to zero by default in this case or shall it
> produce an error?
Zero. See 3.7.1 and 6.7 paragraph 4.