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


Groups > comp.lang.java.programmer > #34217

Re: error: unclosed character literal

Newsgroups comp.lang.java.programmer
Date 2016-04-28 12:56 -0700
References <nfn223$2q2$2@reader1.panix.com> <slrnnhu4gt.456.avl@login.logic.tuwien.ac.at> <2381387d-f93b-48d2-ac09-64a1dd18a744@googlegroups.com> <character-literals-20160426220902@ram.dialup.fu-berlin.de> <nfou69$ic0$1@gioia.aioe.org>
Message-ID <260a9202-29dc-4c28-9906-0b4421752a87@googlegroups.com> (permalink)
Subject Re: error: unclosed character literal
From Lew <lewbloch@gmail.com>

Show all headers | View raw


On Tuesday, April 26, 2016 at 4:39:00 PM UTC-7, Arne Vajhøj wrote:
> On 4/26/2016 5:10 PM, Stefan Ram wrote:
> >   Maybe the person that you have quoted wanted to say
> >   »Character literals consist of a *single* character.«.
> >
> >   But this would not be true, since
> >
> > 'a'
> >
> >   is a character literal and consists of 3 characters.
> 
> I would be willing to consider "consist of" to be a more
> plain version of "expressed as" and therefore valid.

The char literal 'a' consists of the numeric equivalent of the character 'a', which is one character, which itself does not include apostrophes. The literal is the 16-bit item in memory, not the source code representation thereof. Just like the numeral "1" is not the number 1, but a representation thereof, the source-code representation is not the character itself.

So no, the character 'a' does not consist of the three characters '\'', 'a', and '\''. 

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


Thread

error: unclosed character literal Popping mad <rainbow@colition.gov> - 2016-04-26 06:32 +0000
  Re: error: unclosed character literal Andreas Leitgeb <avl@logic.at> - 2016-04-26 06:57 +0000
    Re: error: unclosed character literal Lew <lewbloch@gmail.com> - 2016-04-26 13:51 -0700
      Re: error: unclosed character literal Andreas Leitgeb <avl@logic.at> - 2016-04-26 22:01 +0000
      Re: error: unclosed character literal Andreas Leitgeb <avl@logic.at> - 2016-04-26 22:04 +0000
        Re: error: unclosed character literal Arne Vajhøj <arne@vajhoej.dk> - 2016-04-26 19:34 -0400
          Re: error: unclosed character literal Roedy Green <see_website@mindprod.com.invalid> - 2016-05-25 08:29 -0700
            Re: error: unclosed character literal Lew <lewbloch@gmail.com> - 2016-05-25 14:30 -0700
      Re: error: unclosed character literal Arne Vajhøj <arne@vajhoej.dk> - 2016-04-26 19:38 -0400
        Re: error: unclosed character literal Lew <lewbloch@gmail.com> - 2016-04-28 12:56 -0700
  Re: error: unclosed character literal Roedy Green <inquiry@mindprod.com> - 2016-05-30 21:50 -0700

csiph-web