In any application, there can be only one main function. In c++, main is not a member of any class. There is no chance of overriding
Yes it can possible, behalf of my knowledge we can do it in C language. We can start the program with our own function and end with the same. But the main constraint is we must implement (even null) the main function. because the C compiler should not allow you without main function. This can be happend with #pragma start (function name) directive. I have tried in C and it may possible in C++.
What will be output of the following code #include using namespace std; class abc { public : void main() { cout<<" Its main function "< } }; int main(int c, char **v) { abc a; if(c<1) { cout<<" Error can not accept it "< exit(1); } cout<<" its in main program "< a.main();
How is static variable stored in the memory? ( if there are 2 functions in a file,and the static variable name is same (ex var) in both the function. how is it keep seperately in the memory).
Hey anybody help me to write code for this program wap which display year,month & day presents in a year for eg. 1. no. is 14 print 2 weeks 2. no is 90 print 3 months 3. no is 365 print 1 year user can input any no