Please check the below program.
#include <stdio.h>
struct st
{
int a ;
}
fn ()
{
struct st obj ;
obj.a = 10 ;
return obj ;
}
int main()
{
struct st obj = fn() ;
printf ("%d", obj.a) ;
}
Following are the questions
- What is the output of the program?
Where is ';' terminating the declaration of 'struct st'?
By ISO IEC 9899 - 1999 specification, declaration should end with a ';'.
declaration-specifiers init-declarator-listopt ;
If the declaration of the 'struct st' is taken representing only the return type of the function 'fn', how is it visible to other functions (main)?