Re: How to eliminate this global variable, silent?
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Thu, 17 Apr 2008 19:04:28 -0700
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"
.
- References:
- How to eliminate this global variable, silent?
- From: istillshine
- Re: How to eliminate this global variable, silent?
- From: ymuntyan
- Re: How to eliminate this global variable, silent?
- From: Richard Tobin
- Re: How to eliminate this global variable, silent?
- From: ymuntyan
- Re: How to eliminate this global variable, silent?
- From: Joe Wright
- Re: How to eliminate this global variable, silent?
- From: Chris Dollin
- Re: How to eliminate this global variable, silent?
- From: Keith Thompson
- Re: How to eliminate this global variable, silent?
- From: Joe Wright
- Re: How to eliminate this global variable, silent?
- From: jameskuyper
- Re: How to eliminate this global variable, silent?
- From: Joe Wright
- How to eliminate this global variable, silent?
- Prev by Date: Re: Size of array too large
- Next by Date: Re: ioctl serial port and SIOCGSTAMP
- Previous by thread: Re: How to eliminate this global variable, silent?
- Next by thread: Re: How to eliminate this global variable, silent?
- Index(es):
Relevant Pages
|