I'm not sure if you're specifically asking a question, but yes, your understanding of nested "if"s seems to be correct.
Let's expand your example a bit:
Code:
if (x==0)
{
if (Function()==ERROR)
{
/* this happens */
}
else
{
printf("Function has performed successfully.\n");
}
}
So...
If 'x' is zero...
- if the function returns a code called ERROR, the "this happens" part is executed
- else (if the function does not return an error), a "success" message is printed
If 'x' is NOT zero, the function is not even called since the inner code is not executed.