home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!mailgzrz.TU-Berlin.DE!cs.tu-berlin.de!jutta
- From: jutta@opal.cs.tu-berlin.de (Jutta Degener)
- Subject: Re: Problem with string processing.
- Message-ID: <1993Jan11.192540.26783@cs.tu-berlin.de>
- Sender: news@cs.tu-berlin.de
- Organization: Techn. University of Berlin, Germany
- References: <1idn10INNpvg@calamari.hi.com> <1993Jan11.060615.2180@eagercon.com>
- Date: Mon, 11 Jan 1993 19:25:40 GMT
- Lines: 20
-
- eager@eagercon.com (Michael J. Eager) writes:
- > rogers@calamari.hi.com (Andrew Rogers) writes:
- >> In article <...> alane@wozzle.linet.org (J. Alan Eldridge) writes:
- >>>> char tmp[2] = {0};
- >> tmp[1] most certainly does have a 0 in it; if the initialization list for
- >> an array contains fewer elements than the array itself, then the remaining
- >> array elements are initialized to 0. [..]
- >
- > Well, the relevent section is 3.5.7, which says, in part "If an object that
- > has automatic storage duration is not initialized explicitly, its value is
- > indeterminate." Lacking a 'static' declaration and being within a function
- > means that tmp has automatic storage. Only the first element is initialized
- > to zero, tmp[1] is undefined.
-
- No, the relevant section is 3.5.7, which says, in part "If there are fewer
- initializers in a brace-enclosed list than there are members of an aggregate,
- the remainder of the aggregate shall be initialized implicitly the same as
- objects that have static storage duration."
-
- Jutta (jutta@cs.tu-berlin.de)
-