I am rather in doubts about getting some problems while coding with a few recursive functions. Now here I am giving a simple code with nested function call,so that I can point to my exact problem.
int main(void)
{
int i;
i=a();
printf("%d\n",i);
return 0;
}
int a()
{
return b();
}
int b()
{
return 9;
}
well,no problem at all,it gives output as 9. But if i redefine function a()
as:
int a()
{
b();
int new=0; //not significant
}
Again it producing valid output, .i.e,
9
here, though I removed return
keyword I was not getting any compilation error,neither the value of i
in the output was wrong...(I expected garbage or something like that).
How these things are handled?