You create new functions and call them from main:
void foo() {}
void goo() {}
int main()
{
foo();
goo();
}
There’s nothing technically wrong with having main1
or main2
methods, but there’s only one entry point of a valid C++ program, and that’s main
.
solved Guide to changing int main() [duplicate]