Here an example of my code:
void MyFunc()
{
if(funcA(varA) == 0)
{
if(funcB(varB) == 0)
{
if(funcC(varC) == 0)
{
//Success funcC
}
else
{
//error with funcC
}
}
else
{
//error with funcB
}
}
else
{
//error with funcA
}
}
So the code will be like, if funcA() returns zero ONLY then execute funcB(), if funcB() returns zero ONLY then execute funcC() and so on. My question is how can I replace that nested if...else statements with some other optimized method?