Yes, we can define function within function.
But the scope of inner function will be limited.
We can not call the inner function directly. We need to call the outer function,
this outer function will return the address of the inner function and
we can use this address to call inner function but the stack of outer function will be finished
after returning the address of inner function. So address of inner function will be garbage address.
You can do One thing :
1) Written a outer_functtion with return type is void pointer;
2) declare a inner in this outer function;
Now see the code below
void (*ptr_fun) (void);
printf("\n outer function is called \n");
printf("\n inner function is called \n");
ptr_fun = inner_fun;
pthread_t f2_thread, f1_thread;
pthread_create(&f1_thread, NULL, outer_fun, NULL);
pthread_create(&f2_thread, NULL, f2, NULL);