Quote:
Originally Posted by buddy
can a function be called without calling main( ) function??? please calrify me.. if so plz explain it in detail.
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;
}