Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a question. And I am not able find any relevant answer on Google. My question is How Virtual Function mechanism works. Means what exactly happens at compile time, what exactly happens at run time and how pure virtual functions are stored in VTable.

And exactly how Pure Virtual Function makes a class abstract.

Thanks
Posted
Comments
Sergey Chepurin 26-Mar-12 6:14am    
From highly recommended tutorial -
"Virtual functions": http://www.learncpp.com/cpp-tutorial/122-virtual-functions/ and
"Virtual tables": http://www.learncpp.com/cpp-tutorial/125-the-virtual-table/
VikramRathod 18-Jul-12 7:02am    
Link provided by Sergey Chepurin is so nice , its very simple to understand.

Try this link. CPians have clearly explained about Virtual Functions [^]

Have a look at this also [^]
 
Share this answer
 
v4
Comments
[no name] 26-Mar-12 8:38am    
Thanks 5!.
You may find precious info at C++ FAQ's "[20] Inheritance — virtual functions"[^].
 
Share this answer
 
Comments
[no name] 26-Mar-12 8:38am    
Good Q/A 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900