Re: Why C dont allow the name of a variable start with a digit?
- From: "Bartc" <bc@xxxxxxxxxx>
- Date: Fri, 11 Apr 2008 09:23:05 GMT
"Jason20005" <jason20005@xxxxxxxxx> wrote in message
news:79d0b2ff-cd84-4121-b418-f219c086db98@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dear all,
Why C and some of other languages dont allow the name of a variable
start with a digit?
It's been explained there could be ambiguity between integer constants and
variables.
It might have been feasible where there was no ambiguity (so 0XABC must be a
constant, but 0XABG must an identifier), but it's unsatisfactory. Some other
way of distinguishing constants and identifiers would be needed, and this
would offset some advantage of starting with a digit.
More useful (to me anyway) would have been the ability to use $ in an
identifier (available on some Cs but not standard). Then it could have been
used in place of _, which is difficult to see and can be confused with __
and ___.
--
Bart
.
- Follow-Ups:
- References:
- Why C dont allow the name of a variable start with a digit?
- From: Jason20005
- Why C dont allow the name of a variable start with a digit?
- Prev by Date: Re: "ab" mode in fopen
- Next by Date: Re: what is NULL pointer dereferencing
- Previous by thread: Re: Why C dont allow the name of a variable start with a digit?
- Next by thread: Re: Why C dont allow the name of a variable start with a digit?
- Index(es):
Relevant Pages
|