Question:
Can u have inline virtual functions in a class?
Answer:
Source: CoolInterview.com
Yu may, but the compiler will turn down the inline request and treat it as a normal function.
The reason virtual fn cannot be inline are that a vtab is created for every class that have the address of all member function. Since inline fn do not have a address, virtual fns have to be treated non inline. Source: CoolInterview.com
Answered by: Hussain Kothari | Date: 7/15/2010
| Contact Hussain Kothari
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.
|