Apr 27, 2009 at 3:20pm
You can't. As simple as that.
The closest you can get to your example is this:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
switch (i){
case 0:
{
switch (j){
case 0:
matrix_tmp[i][j] = 77;
break;
//...
}
}
break;
//...
}
|
Last edited on Apr 27, 2009 at 3:20pm
Apr 28, 2009 at 6:49pm
or you could use std::pair<int,int> or whatever struct/class you decalre that has 2 or more data members
Apr 28, 2009 at 6:54pm
switch only works for integral types (char, short, long, int, etc.). It can't be used for floating point values and it can't be used for objects.