c++ - The use of declaring function inside a function? -
possible duplicate:
is there use function declarations inside functions?
i know inside function can declare function. use of it? can please bring simple example?
there little value declaring function inside function, unless intend on defining later , having available function- i.e., function declaration encapsulated.
int main() { void foo(); foo(); } void some_other_func() { foo(); // error } void foo() { }
but that's it. in comparison triggering vexing parse, extremely limited benefit @ best.
Comments
Post a Comment