Author Topic: Switch statement  (Read 5075 times)

acbaile

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Switch statement
« Reply #15 on: November 13, 2018, 05:50:45 AM »
    continue looks good. What do you think?

    switch(variant){
        case 1: continue;
        case 2: continue;
        case 3: a = 5;
        default: a = 0;
    }

continue execution. Meaning is common, without relation to cycles only.
« Last Edit: November 18, 2018, 02:38:13 AM by acbaile »

bas

  • Full Member
  • ***
  • Posts: 209
    • View Profile
Re: Switch statement
« Reply #16 on: November 13, 2018, 09:00:47 AM »
If you put a switch inside a while/for loop, continue currently means: jump to the next loop

acbaile

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Switch statement
« Reply #17 on: November 13, 2018, 05:34:44 PM »
If you put a switch inside a while/for loop, continue currently means: jump to the next loop

    Why do you say it? ??? My level of C is enough to understand it. And i know that switch in C2 is the same with C at this moment.

    It's proposal for good keyword instead of fallthrough - if you decide to introduce auto-break.
« Last Edit: November 18, 2018, 02:34:53 AM by acbaile »

acbaile

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Switch statement
« Reply #18 on: November 18, 2018, 01:02:06 AM »
If you put a switch inside a while/for loop, continue currently means: jump to the next loop

    It seems, you did not read previous posts in this topic. This one is not unique. Previously i discussed about fallthrough. Here: http://www.c2lang.org/forum/index.php?topic=23.msg510#msg510

« Last Edit: November 18, 2018, 02:26:23 AM by acbaile »