Switch problem - Kdevelop 2.0.1

James Allen jallen at mandtbank.com
Wed Nov 14 16:44:46 GMT 2001


Redhat 7.2
Kdevelop 2.0.1
The following switch statement does not work with single quotes around the case constant expression (works if the single quotes are removed):

int sel=0;
switch(sel)
    {
     case '1' :          gather(0);               break:
     case '2' :          prntout(front,0);      break;
     case '3' :          prntout(front,1);      break;
     case '4' :          stats(front);             break;
     case '5' :          erase(front);            break;
     case '6' :          convert();                break;
     case '7' :          
             {
              wrt_all(front);
              clrscr();
              exit(0);
              }
     default:
              {
               printf(( "     Please input 1 thru 7 only.\n");
               break;
               }

Another switch in a different function (same program) works fine with the single quotes.


-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list