Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: error: initializer element is not constant| Date: Mon, 08 May 2017 12:44:53 -0700 Organization: None to speak of Lines: 40 Message-ID: References: <653QA.1704$wa2.1014@fx36.am4> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="6d7e0aa3e5b7ac222e8546bcb39ccb10"; logging-data="17144"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/9g9OBKN4VLlZUzZ90yea" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:NpwTg+QzTFxMF1Wvrb4DsZdnm44= sha1:NLRj2zTzkglQ+0OjcyJTI0fTyD0= Xref: csiph.com comp.lang.c:109535 bartc writes: > On 08/05/2017 19:37, Keith Thompson wrote: >> bartc writes: >>> On 08/05/2017 17:00, Keith Thompson wrote: >> [...] >>>> I think you meant that arrays of pointers to arrays would be unusual. >>> >>> No, I mean arrays of pointers to strings, with a string meaning char*. >>> The variable names I've chosen should make it clear that: >>> >>> str (ie. string) is a char* >>> ptr_to_str is char** >>> >>> and so on. >> >> Then you are using terminology that is clearly defined by the C standard >> in a manner inconsistent with the way the standard uses it. >> >>> Since it is impossible to work with an actual string itself, it's more >>> useful I think for 'string' to be a synonym for 'char*'. >> >> Whether it would have been more useful or not, the standard clearly >> defines the terms "string" and "pointer to string" in 7.1.1p1, which >> I've recently quoted elsewhere in this thread. > > So you call a 'pointer to char', a 'pointer to string'. I call a char* value a "pointer to a string" if and only if it points to the initial character of a string. A null char* pointer is not a pointer to a string. Do you find the definitions I quoted unclear? [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"