Syntax problem
C#
3
Posts
3
Posters
0
Views
1
Watching
-
Hi , anyone please help me how to make multiple scenorio in case. i tried with , operator but it gives error. example, switch(a) { case q,y: ... }
-
try switch(a) { case q: case y: { ur calculations......(it should work for both case q and case y) } break; ... }
rahul
You don't need the additional body! {} wastes some time and is often unnecessary. (I bet it pushes and pops the stack)
switch(a){
case q:
case y:
...
break;
}A man said to the universe: "Sir I exist!" "However," replied the Universe, "The fact has not created in me A sense of obligation." -- Stephen Crane