|
-
December 15th, 2005, 07:17 AM
#1
what happens when case has no content
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 "=" ??
-
December 15th, 2005, 07:23 AM
#2
Re: what happens when case has no content
-
December 15th, 2005, 07:31 AM
#3
Re: what happens when case has no content
It enters the next case because there is no "break" at the end of it, not because it has no content.
Code:
switch ( x )
{
case 1:
func1();
case 2:
func2();
};
if x is 1 it will do func1() and func2(), if x is 2 it will do only func2().
-
December 15th, 2005, 08:00 AM
#4
Re: what happens when case has no content
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|