Hello Brian.
AM>> Shouldn't the above give an error? '/a' is more than one char. I think
AM>> you meant '\a' which is an escape code.
BW> No, no error, and '/a' is what I meant, but I think you're right. A
BW> compiler should post an error or at least a warning, IMHO. I started
BW> using two char constants a couple years ago, not realizing it was a bad
BW> idea, and not at all portable evidently... Now I'd like to rewrite all
BW> the code that uses this type, and I'm looking for the best way.
I always do something like this, which has served well over time...
while( --argc )
{
p = argv[argc];
if( *p == '/' )
{
switch( toupper( *++p ))
{
case 'A':
This is pure C... there may be a more OO or C++ way to do it.
-Roger
... If you're straight, don't say "Kiss my butt" to a gay person.
--- Msged 4.20 beta 3
(1:273/404@fidonet)
---------------
* Origin: Hodge-Podge Support BBS, Upper Darby, Pennsylvania, USA
|