Nested function in C

You cannot define a function within another function in standard C.

You can declare a function inside of a function, but it’s not a nested function.

gcc has a language extension that allows nested functions. They are nonstandard, and as such are entirely compiler-dependent.

Leave a Comment