Problem with constants (MSVC)

H

h79

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
 
V

Victor Bazarov

h79 said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top