Question:
Can main() be overridden?
Answer:
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 Source: CoolInterview.com
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++. Source: CoolInterview.com
Answered by: Ravi Shanklar | Date: 12/10/2007
| Contact Ravi Shanklar
I think that main(),being a function can be overriden as per the rule. Source: CoolInterview.com
Answered by: himanshu | Date: 1/5/2010
| Contact himanshu
No, it is not possible any language because execution start with Main,and there no use even though if overloaded methods are present. Source: CoolInterview.com
Answered by: srinu | Date: 1/12/2010
| Contact srinu
no,main can be overriden
regards, Nicku Source: CoolInterview.com
Answered by: nicku | Date: 8/16/2010
| Contact nicku
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|