S
sureshjayaram
In some functions where i need to return multiple error codes at
multiple places, I use multiple return statements. Say for ex.
if (Found == 1)
{
if (val == -1)
return error1;
}
else
{
if (val2 == -1)
return error2;
}
return success;
This is just a simple example. My case have lot of conditional
statements.
the alternate approach is to use goto statements. Let me know the
better way of doing this and which is preferrable (multiple return
statements or Goto's)
Thanks,
multiple places, I use multiple return statements. Say for ex.
if (Found == 1)
{
if (val == -1)
return error1;
}
else
{
if (val2 == -1)
return error2;
}
return success;
This is just a simple example. My case have lot of conditional
statements.
the alternate approach is to use goto statements. Let me know the
better way of doing this and which is preferrable (multiple return
statements or Goto's)
Thanks,