Nested function
Nested function
#include <stdio.h>
int main(void)
printf("Main");
int fun()
{
printf("fun");
int view()
printf("view");
return 1;
view();
Output:
Compile time error: undefined reference to `view'
An extension of the GNU C Compiler allows the declarations of
nested functions. The declarations of nested functions under GCC’s
extension need to be prefix/start with the auto keyword.
#include <stdio.h>
int main(void)
printf("Main\n");
int view()
printf("View\n");
return 1;
printf("GEEKS");
return 0;
Output:
view
Main
GEEKS