Null revisited (briefly)

Mark Nagel nagel at blanche.ics.uci.edu
Thu Mar 2 08:09:12 AEST 1989


In article <1207 at hudson.acc.virginia.edu>, gsh7w at astsun1 (Greg Hennessy) writes:
|Mark Nagel writes:
|#If you knew the C language, you'd know that a character constant *is*
|#an integer.  See K&R page 17 and 35.

|Picking up the Bible (K&R) and quoting without permission from page 17

We're going to be that way, hmm?

|Any single character can be written between single quotes, to produce
|a value equal to the numerical value of the character in the machine's
|character set; this is called a {\it character constant}. So, for
|example, 'A' is a character constant; in teh ASCII character set its
|value is 65, the internal representation of the character A.

Instead of quoting points that say nothing, why not take a look a bit
further down on the page:

"You should note carefully that '\n' is a single character, and in
expressions is equivalent to a single integer; ..."

|and page 35 says
|
|A {\it character constant\/} is a single character written within
|single quotes, as in 'x'.

as well as:

"Character constants participate in numeric operations just as any
other numbers, although they are most often used in comparisons with
other characters."

It's not clear that you are refuting my references above, although you
have certainly left out of your quotations the relevant points.

Mark Nagel @ UC Irvine, Dept of Info and Comp Sci
ARPA: nagel at ics.uci.edu              | Charisma doesn't have jelly in the
UUCP: {sdcsvax,ucbvax}!ucivax!nagel  | middle. -- Jim Ignatowski



More information about the Comp.lang.c mailing list