TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: BRIAN WOOD
from: TOM TORFS
date: 1998-01-22 22:32:00
subject: `/a`=?

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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.