HB> '/a' is not valid. The differences in compilers you are see is the
HB> compiler attempting to work with your mistake.
Yeah, that's why I'm asking the question. Thanks for the code! With a
couple of corrections it works, though it gets the args in reverse
order. Shouldn't be too hard to work with.
HB> int parms = argc - 1;
HB> char *ptr = argv[parms];
HB> while (parms-- && ptr)
HB> {
HB> cout << "arg entered was: "
HB> if (ptr == '/') // (*ptr=='/') is correct
HB> {
HB> switch (++ptr) // switch(*(++ptr)) is correct
HB> {
HB> case 'a':
HB> case 'A': cout << "/a" << endl; break;
HB> default: cout << (--ptr) << "(unknown)" << endl;
HB> }
HB> }
HB> else
HB> cout << ptr << "(unknown unswitched)" << endl;
HB> ptr = argv[parms];
HB> }
L8r,
bw
... Every time I have all the answers, someone changes the questions!
--- Blue Wave/DOS v2.20
---------------
* Origin: River Canyon Rd. BBS Chattanooga, Tn (1:362/627)
|