Hi Tom,
BW>> cout << "The value of /a is " << (char)'/a' << endl;
BW>> Borland will send a backslash. Microsoft, the letter a.
> That is strange, there is no backslash involved, I only see forward
lashes.
> By the way, I believe a char literal should only be 1 character long
unless
> you're trying to use the escape code for alert, which is '\a').
I don't think this is strange.
Internally chars are treated as ints... 2 bytes are allocated for that.
the ASCII-Code for '/' is 47 and for 'a' it is 97
It seems that Microsoft doesn't really convert the expression '/a' to int
but simply performs a copy. Normally ints are stored with LOW-BYTE first,
then HIGH-BYTE ---> correctly it should be stored as 97 47 = 97*256 + 47 =
24879 (the way Borland does) ! Microsoft stores it as 47 97 = 47*256 + 97
= 12129.
bye
Frank
--- XPoint
---------------
* Origin: VGA-Planets, was sonst ... (2:245/6837.11)
|