This question has a similar title but we are discussing different things.
Say I want to invoke the main of a code foo.c
int main(){ ... } The problem is that the caller is another main routine, and it seems impossible to have two main functions.
How can I call foo.c's main function from another main?
The name of the main in foo.c cannot be changed, because it is not a user-code.
exec(),system()?