This is not a lambda function question, I know that I can assign a lambda to a variable.
What\'s the point of allowing us to declare, but not define a function insid
Specifically answering this question:
From the answers it seems that there in-code declaration may be able to prevent namespace pollution, what I was hoping to hear though is why the ability to declare functions has been allowed but the ability to define functions has been disallowed.
Because consider this code:
int main()
{
int foo() {
// Do something
return 0;
}
return 0;
}
Questions for language designers:
foo() be available to other functions?int main(void)::foo()?