I found a quick fix for now, but I'm still curious about why an
expression like '/a' could be evaluated two different ways on the same
machine, using different compilers.
By fooling around and doing stuff like this...
cout << "Expression /a in hex = " << hex << '/a' << endl;
and checking the output, I've realized that Microsoft v 8.00 is 'seeing'
this two char constant right-to-left, while Borland sees it
left-to-right. Adding a case 'a/': fixes the problem for now.
while(--argc && **argv++) {
cout << "command-line switch = ";
switch(*(int*) *argv) {
case '/a': case 'a/':
cout << "/a" << endl;
break;
default:
cout << *argv << " (unknown)" << endl;
break;
}
}
I suppose the problem is "undefined", "non-portable" solutions
implemented by each vendor on how to handle multi-byte character
constants?? Is there a simple, portable way to do the above?
L8r,
bw
... If all goes well, you've overlooked something!
--- Blue Wave/DOS v2.20
---------------
* Origin: River Canyon Rd. BBS Chattanooga, Tn (1:362/627)
|