Xref: utzoo comp.lang.c:32637 comp.std.c:3702 Path: utzoo!attcan!uunet!mcsun!hp4nl!orcenl!bengsig From: bengsig@oracle.nl (Bjorn Engsig) Newsgroups: comp.lang.c,comp.std.c Subject: Re: Initializing arrays of char Message-ID: <1006@nlsun1.oracle.nl> Date: 5 Oct 90 08:57:19 GMT References: <1990Oct4.152756.6850@micrognosis.co.uk> <15674@csli.Stanford.EDU> Reply-To: bengsig@oracle.nl (Bjorn Engsig) Followup-To: comp.std.c Organization: Oracle Europe, The Netherlands Lines: 17 re: char mesg[5] = "help!"; /* what about the null terminator? */ The ANSI standard says (3.5.7): "Successive characters of the character string literal (including the terminating null character if there is room or if the array is of unknown size) initialize the elements of the array." and the rationale mentions: "(Some widely used implementations provide precedent.)" further, it fits well with the way strncpy() works. -- Bjorn Engsig, Domain: bengsig@oracle.nl, bengsig@oracle.com Path: uunet!mcsun!orcenl!bengsig From IBM: auschs!ibmaus!cs.utexas.edu!uunet!oracle!bengsig