what happens in the following case
Code:switch(somechar)
{
...
....
case '=' :
case 'D' ://do something
break;
}
will case 'D" also be entered when the character is "=" ??
Printable View
what happens in the following case
Code:switch(somechar)
{
...
....
case '=' :
case 'D' ://do something
break;
}
will case 'D" also be entered when the character is "=" ??
Yes.
It enters the next case because there is no "break" at the end of it, not because it has no content.
if x is 1 it will do func1() and func2(), if x is 2 it will do only func2().Code:switch ( x )
{
case 1:
func1();
case 2:
func2();
};
thanks folks.