Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #89218

Re: efficient coding with literals and variables

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: efficient coding with literals and variables
Date 2016-06-15 14:53 -0700
Organization None to speak of
Message-ID <ln8ty6xgnt.fsf@kst-u.example.com> (permalink)
References <literals-20160614201332@ram.dialup.fu-berlin.de> <njpnbq$je8$1@dont-email.me> <njqucm$1e9$1@dont-email.me> <slrn3vfsnm3hqh.i2o.ike@iceland.freeshell.org>

Show all headers | View raw


Ike Naar <ike@iceland.freeshell.org> writes:
> On 2016-06-15, David Brown <david.brown@hesbynett.no> wrote:
>> I think it is far nicer to put type qualifiers such as "const" or
>> "volatile" at the start of the declaration - "const int", not "int
>> const".  But that is personal opinion, and I'm not sure I can give a
>> better justification than "I think it is nicer or clearer".  If others
>> have better reasons for picking one way or the other, I'd be interested
>> to hear.
>
> The terminology used in the C standard documents is "integer constant",
> not "constant integer".

No, an "integer constant" is, for example, 42 or 0xff.  "const" does not
mean constant; it means read-only.

The examples in the C standard typically have "const" and/or "volatile"
at the beginning of the declaration (except in cases where it has to
follow a "*", for example).

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
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"

Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: efficient coding with literals and variables BartC <bc@freeuk.com> - 2016-06-14 20:53 +0100
  Re: efficient coding with literals and variables David Brown <david.brown@hesbynett.no> - 2016-06-15 08:59 +0200
    Re: efficient coding with literals and variables Keith Thompson <kst-u@mib.org> - 2016-06-15 10:01 -0700
      Re: efficient coding with literals and variables David Brown <david.brown@hesbynett.no> - 2016-06-15 19:47 +0200
        Re: efficient coding with literals and variables Keith Thompson <kst-u@mib.org> - 2016-06-15 11:47 -0700
    Re: efficient coding with literals and variables Ike Naar <ike@iceland.freeshell.org> - 2016-06-15 21:23 +0000
      Re: efficient coding with literals and variables David Brown <david.brown@hesbynett.no> - 2016-06-15 23:53 +0200
        Re: efficient coding with literals and variables Ike Naar <ike@iceland.freeshell.org> - 2016-06-15 22:41 +0000
          Re: efficient coding with literals and variables "James R. Kuyper" <jameskuyper@verizon.net> - 2016-06-15 18:54 -0400
            Re: efficient coding with literals and variables Ike Naar <ike@iceland.freeshell.org> - 2016-06-16 05:41 +0000
          Re: efficient coding with literals and variables David Brown <david.brown@hesbynett.no> - 2016-06-16 09:12 +0200
      Re: efficient coding with literals and variables Keith Thompson <kst-u@mib.org> - 2016-06-15 14:53 -0700

csiph-web