home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19545 < prev    next >
Encoding:
Text File  |  1993-01-11  |  1.5 KB  |  32 lines

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