- #1
sk1105
- 88
- 12
Currently in my C++ program I have something like
and so on. Unfortunately this has to be done for a very large sample and it takes quite a long time. I was just wondering if it's more efficient to use nested if statements i.e.
Or would it make no/negligible difference?
Code:
if (A){
do thing 1;
}
if (A && B){
do things 1 and 2;
}
if (A && B && C){
do things 1 and 2 and 3;
}
Code:
if (A){
do thing 1;
if (B){
do thing 2;
if (C){
do thing 3;
}
}
}