can a function be called without calling main( ) function??? please calrify me.. if so plz explain it in detail.
No. Main is called by the executive that launches the program. One should never call main explicitly. The effects of doing so result in undefined operation.
Yes a function can be called without calling the main or I would say a function can be executed before the main function is executed. Try running this program. Code: #include<iostream> using namespace std; int func() { cout<<"In Func"<<endl; return 10; } static int i = func(); int main() { cout<<"In Main"<<endl; return 0; }