What you do is a specific GCC function , it has never been a βproperβ C function (i.e., part of the ANSI C specification).
If you want to use this function, I believe that you are following this:
#include <stdio.h> int a = 20, b = 11; int main( int argc, char* argv[] ) { int a = 5, b = 60; auto int func( void ); printf("\nI am in main-1"); int func( void ) { printf("\nI am in funct"); return 1; } printf("\nI am in main-2"); return func(); }
The reason your previous code didn't work is because the nested functions are not bound:
A nested function always has no binding. Declaring one with an external or static error. If you need to declare a nested function before defining it, use auto (which is otherwise pointless for function declarations).
The above example uses the auto keyword. I also took the liberty of fixing your ad main
source share