Re: How to eliminate this global variable, silent?



Joe Wright <joewwright@xxxxxxxxxxx> writes:
[...]
Damn, this is a tough room. I now concede a[2] an expression, not an
identifier.

Perhaps what you meant is that a[2] is a name, rather than an
identifier. (But given the way the C standard uses the term "name",
it's not a name either.)

But it is an object of type int and a variable. Right?

It's an object of type int, yes. More precisely, a[2] is an
expression, more specifically an lvalue, that refers to an object of
type int. We can and do refer to that object as a[2]. Of course
there are plenty of other ways we could refer to it, such as *(a+2) or
*p (the latter requires an appropriate declaration and current value
for p).

Is it a variable? That depends on how you define the term. If you
can construct a definition of the term "variable" based on terms
defined in the C standard, you can determine whether a[2] is a
variable. Somebody else can just as easily construct another
definition that settles the question the other way.

--
Keith Thompson (The_Other_Keith) <kst-u@xxxxxxx>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.



Relevant Pages

  • Re: Is "scope" different from "visibility" ?
    ... The standard does not specifically define "visibility" but it ... Within the inner scope, the identifier designates the entity ... context disambiguates uses that refer to different entities. ...
    (comp.lang.c)
  • Re: Another spinoza challenge
    ... define such an identifier, ... That means it is syntactically valid, but not valid in user code as ... far as the C standard is concerned. ... If the English language, the ...
    (comp.lang.c)
  • Re: What is a null pointer constant?
    ... > My position is that every instance where the standard writes a keyword ... > is not intended to refer to that keyword literally, ... preprocessing tokens. ... >> can be done in a part of a program that doesn't use any standard macros ...
    (comp.std.c)
  • Re: Another spinoza challenge
    ... define such an identifier, ... far as the C standard is concerned. ... note that the standard does not define every single word used ... defined in the domain of the base language. ...
    (comp.lang.c)
  • Re: the Rationale, string literals, and const (was: lower case to upper case)
    ... >> According to the Rationale, ... identifier that doesn't clash with others in the program. ... > C89 broke existing code. ... Although there was no standards body ratified standard before C89, ...
    (comp.lang.c)