Sep 28, 2010 at 10:08pm UTC
1 2 3 4 5 6 7 8 9
switch (sub){
case 'Math' :
case 'math' :
memsbjt = "math';
return 0;
can i ommit the
break; statement if i use
return "any value"; statement.
Last edited on Sep 28, 2010 at 10:10pm UTC
Sep 28, 2010 at 10:39pm UTC
Yes, the return will always jump out of the switch ( since it jumps out of the enclosing function ) so the control flow won't reach following case labels
Sep 28, 2010 at 10:41pm UTC
If its inside of a function wouldn't jump out of the whole function?
So the control flow retuns to its calling function ( the function that called the function the switch statement was in ) right?
Last edited on Sep 28, 2010 at 10:42pm UTC