Problem with constants (MSVC)

Discussion in 'C++' started by h79, Aug 30, 2004.

  1. h79

    h79 Guest

    Hi.

    Could someone tell me why

    'ab\0\0'

    is compiled in 0x00616200, but not in 0x61620000 ?

    Example:

    ....
    case 'ab\0\0':
    ....

    is the same as (after compilation):

    ....
    case 0x00616200:
    ....

    but should be:

    ....
    case 0x61620000:
    ....

    THX
    Harnas
    h79, Aug 30, 2004
    #1
    1. Advertising

  2. h79 wrote:
    > Could someone tell me why
    >
    > 'ab\0\0'
    >
    > is compiled in 0x00616200, but not in 0x61620000 ? [...]


    The value of the multicharacter character literal is implementation-
    defined. IOW, the Standard doesn't specify what the resulting value
    should be, it is at the discretion of the compiler.

    Since it's implementation-defined, you should ask in a newsgroup for
    your compiler, microsoft.public.vc.language.

    Victor
    Victor Bazarov, Aug 30, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan
    Replies:
    0
    Views:
    1,102
  2. Arkadiy Vertleyb
    Replies:
    1
    Views:
    1,432
    Victor Bazarov
    Jul 9, 2003
  3. =?ISO-8859-1?Q?Christian_Engstr=F6m?=

    Another base/derived problem with gcc, but not with MSVC

    =?ISO-8859-1?Q?Christian_Engstr=F6m?=, Feb 12, 2004, in forum: C++
    Replies:
    7
    Views:
    357
    John Harrison
    Feb 13, 2004
  4. h79
    Replies:
    2
    Views:
    415
  5. icedac
    Replies:
    1
    Views:
    347
    Bogdan Sintoma
    Feb 2, 2005
Loading...

Share This Page