case statements

Hi all

i have an array of 8 elements and then i have to do a different operation on some of the elements
right now i am doing something like this
switch(array_index){
case 0,1:
do some operations...
break;..and so on

but i get an error that says....expectd a ":"
can anyone please tell me how do i access the desired elements of an array to further operate on them??

thanks
You can't use case 0,1:

If you want multiple cases to hit the same code, you do it this way (which is why break; is important):

1
2
3
4
case 0:
case 1:
//blah blah
break;
thank u thank u :) :)
Topic archived. No new replies allowed.