Path: utzoo!utgpu!utcsri!jarvis.csri.toronto.edu!dgp.toronto.edu!flaps From: flaps@dgp.toronto.edu (Alan J Rosenthal) Newsgroups: comp.lang.c Subject: Re: { initializer-list , } Message-ID: <8803140345.AA01578@explorer.dgp.toronto.edu> Date: 14 Mar 88 03:45:28 GMT Article-I.D.: explorer.8803140345.AA01578 Posted: Sun Mar 13 22:45:28 1988 References: <660@kuling.UUCP> Organization: University of Toronto Lines: 24 In article <660@kuling.UUCP> bjornc@kuling.UUCP (Bj|rn Carlsson) writes: >Why is an optional trailing comma inside the braces after an >initializer-list allowed? Ah, this is a very useful thing. Suppose you have something like: struct thatthing stuff[] = { { "squid", 145, 5.2, "fish" }, { "parsley", 130, 2.5, "vegetable" }, { "flaps", 556, 2.1, "human" }, { "C", 11, 0.598, "programming language" }, }; It is _much_ easier to edit a list like this if every line has the same format, including the trailing comma. It is also somewhat easier to generate automatically. >Is it included in the Draft proposed ANSI C? Yes. -- If you had eternal life, would you be able to say all the integers?