Click here to Skip to main content
15,793,735 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pure virtual functions Pin
Stuart Dootson17-Sep-09 22:45
professionalStuart Dootson17-Sep-09 22:45 
GeneralRe: pure virtual functions Pin
hrishiS17-Sep-09 23:25
hrishiS17-Sep-09 23:25 
GeneralRe: pure virtual functions Pin
Cedric Moonen17-Sep-09 22:00
Cedric Moonen17-Sep-09 22:00 
AnswerRe: pure virtual functions Pin
Kushagra Tiwari17-Sep-09 21:44
Kushagra Tiwari17-Sep-09 21:44 
GeneralRe: pure virtual functions Pin
Cedric Moonen17-Sep-09 21:53
Cedric Moonen17-Sep-09 21:53 
GeneralRe: pure virtual functions Pin
hrishiS17-Sep-09 21:55
hrishiS17-Sep-09 21:55 
AnswerRe: pure virtual functions Pin
«_Superman_»17-Sep-09 21:44
professional«_Superman_»17-Sep-09 21:44 
AnswerRe: pure virtual functions Pin
Cedric Moonen17-Sep-09 21:51
Cedric Moonen17-Sep-09 21:51 
In addition to previous replies, the usage of pure virtual functions is needed:
- when your base class should not be instanciated: if a class contains a pure virtual function, you cannot instanciate it.
- when you want to enforce child classes to override the virtual function: if a child class doesn't override the pure virtual function, it cannot be instanciated.

In that specific case, it makes a lot of sense to use pure virtual functions: if you later add some child classes to the base class, the compiler will make sure you provide the required functions.

Cédric Moonen
Software developer

Charting control [v2.0]
OpenGL game tutorial in C++

GeneralRe: pure virtual functions Pin
hrishiS17-Sep-09 22:00
hrishiS17-Sep-09 22:00 
GeneralRe: pure virtual functions Pin
Cedric Moonen17-Sep-09 22:12
Cedric Moonen17-Sep-09 22:12 
GeneralRe: pure virtual functions Pin
CPallini17-Sep-09 23:09
mveCPallini17-Sep-09 23:09 
AnswerRe: pure virtual functions Pin
RugbyLeague17-Sep-09 23:09
RugbyLeague17-Sep-09 23:09 
GeneralRe: pure virtual functions Pin
hrishiS17-Sep-09 23:28
hrishiS17-Sep-09 23:28 
GeneralRe: pure virtual functions Pin
RugbyLeague17-Sep-09 23:43
RugbyLeague17-Sep-09 23:43 
AnswerRe: pure virtual functions - an example for you. Pin
Iain Clarke, Warrior Programmer18-Sep-09 0:00
Iain Clarke, Warrior Programmer18-Sep-09 0:00 
QuestionDifferentiating SHUTDOWN and RESTART ? Pin
Kushagra Tiwari17-Sep-09 21:29
Kushagra Tiwari17-Sep-09 21:29 
AnswerRe: Differentiating SHUTDOWN and RESTART ? Pin
«_Superman_»17-Sep-09 21:42
professional«_Superman_»17-Sep-09 21:42 
GeneralRe: Differentiating SHUTDOWN and RESTART ? Pin
Kushagra Tiwari17-Sep-09 21:46
Kushagra Tiwari17-Sep-09 21:46 
QuestionRe: Differentiating SHUTDOWN and RESTART ? Pin
Kushagra Tiwari17-Sep-09 23:25
Kushagra Tiwari17-Sep-09 23:25 
GeneralRe: Differentiating SHUTDOWN and RESTART ? Pin
David Crow18-Sep-09 7:26
David Crow18-Sep-09 7:26 
GeneralRe: Differentiating SHUTDOWN and RESTART ? Pin
kilt21-Sep-09 1:45
kilt21-Sep-09 1:45 
Questionusing boost::bind cause error prj0002 Pin
fley_fly17-Sep-09 20:58
fley_fly17-Sep-09 20:58 
AnswerRe: using boost::bind cause error prj0002 Pin
Stuart Dootson17-Sep-09 21:50
professionalStuart Dootson17-Sep-09 21:50 
QuestionOutlook Automation Pin
john563217-Sep-09 20:29
john563217-Sep-09 20:29 
QuestionWM_LBUTTONUP does not trigger, please help Pin
Isuru_Perera17-Sep-09 20:27
Isuru_Perera17-Sep-09 20:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.