3 ms·
GNU C has had nested functions for quite a long time. I would use them a lot if they were standardized. https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html
by jedbrown 6y ago
GNU C has had nested functions for quite a long time. I would use them a lot if they were standardized. https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html
- WalterBright 6y agoD's differs in that: 1. you cannot "goto" out of the nested function 2. you can declare them "static", which means they don't have a static link and cannot access the enclosing function's variables 3. if garbage collection is enabled, you can pass a pointer to the function out of the enclosing function's scope and still safely access its variables 4. they work in `extern (C++)` functions, too