Code:#include <stdio.h> struct { void (*x)( char *); }X; void init() { void p( char *s) { puts( s); } X.x = p; } void ext() { X.x("Wener"); } int main(int argc, char *argv[]) { init(); X.x("Wener"); ext(); return 0; }
Code:#include <stdio.h> struct { void (*x)( char *); }X; void init() { void p( char *s) { puts( s); } X.x = p; } void ext() { X.x("Wener"); } int main(int argc, char *argv[]) { init(); X.x("Wener"); ext(); return 0; }
online waiting
There are no nested functions in C.
Kurt
in Cfree, i can not run over, but in mingw and cygwin it's no problem. so why?
GCC supports nested functions in C, as a language extension.
Kurt
EDIT: Just looked it up. c-free seems to be an ide that uses gcc as the compiler by default. if so then you propably use different optiions ( gcc -std=... )
Last edited by ZuK; 04-19-2012 at 07:41 AM.
ok, i was wrong, even it pass the compile
thank you