Brian Wood wrote in a message to All:
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 slashes.
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').
BW> or without the cast:
BW> cout << "The value of /a is " << '/a' << endl;
BW> Borland evaluates 24879. Microsoft 12129...??
'/a' is probably treated as an integer. I think you've got yourself some
undefined behaviour here, but I'm not a C++ expert.
greetings,
Tom
tomtorfs@village.uunet.be
--- timEd/2 1.10+
---------------
* Origin: 80X86 BBS 32-15-24.62.32 V.34/V.FC (24h/24h) (2:292/516)
|