I try to make an long if-statement more compact; this is how it is originaly:
char x;
if(list.size()== 1){
x = 'a';
}
if(list.size()== 2){
x = 'b';
}
if(list.size() == 3){
x = 'c';
}
if(list.size() == 4){
x= 'd';
}
Is there a possibility to compact this code?
thanks already, Jari Van M
Aucun commentaire:
Enregistrer un commentaire