Interview Question
Country: United States
I explained the reason why only printf inside main() is working.
And how compiler is able to calculate size of return type of the function fun().
@shondik : my question is that why is the function not called . Any reason or should i remember it as a rule ?
Output will be 4. An expression is never evaluated inside sizeof operator.
- Aashish July 02, 2012So, the function will not be called. However, you must be surprising that how the compiler is able to output 4. Its because compiler sees the signature of the function. Change the return type to double & you will see the output 8.