True, we can't define a function within another function in standard C. gcc has an extension that allows nested functions - http://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html
On Tuesday, October 2, 2012 3:37:04 PM UTC-4, rahul sharma wrote: > > Guys i have read that we cant define function in another function in c > Then why this followung program running fine on gcc > > #include<stdio.h> > void abc() > { > printf("bac"); > void abf() > { > printf("bas"); > getchar(); > } > } > int main() > { > abc(); > getchar(); > } > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/DlcE8Yl85Q4J. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.