This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Please help baby C programmer...


I am having trouble with the switch / case statement.

In my program I have a nested case statement.

switch (a){
    case 1:
        switch (b){
           case 1:
               statement1
               break;
           case 2
               statement 2
               break;
          }/* close switch b */
    case 2:
         switch (b){
            case 1:
               statement 1
               break;
            case 2:
               statement 2
               break;
          } /* close switch b*/

  }/* close switch a */

---------
Is is OK to nest switch statements?

Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]