I have search through google/stack overflow etc. but I could not find the proper/exact solution for this. I know latest C++ revision supports Lambda function by which we can achieve, and also I know we should avoid defining a function inside another function. But I'm curious why can not we have function definition inside function according to C++ standard?.
like following:
int print() {
void test(){
// statements
}
}
I know people will mark this as duplicate but in those questions no one has given satisfactory answer, to make this to be highlight I have asked here.