Click here to Skip to main content
15,915,600 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionGet Object id from PhoneGetCallLogEntry Pin
bodaay9-Sep-06 6:11
bodaay9-Sep-06 6:11 
QuestionProblem with calcutation. Pin
EzraYap9-Sep-06 5:59
EzraYap9-Sep-06 5:59 
AnswerRe: Problem with calcutation. Pin
bodaay9-Sep-06 6:15
bodaay9-Sep-06 6:15 
GeneralRe: Problem with calcutation. Pin
EzraYap9-Sep-06 6:21
EzraYap9-Sep-06 6:21 
GeneralRe: Problem with calcutation. Pin
Rick York9-Sep-06 10:21
mveRick York9-Sep-06 10:21 
GeneralRe: Problem with calcutation. Pin
EzraYap10-Sep-06 2:31
EzraYap10-Sep-06 2:31 
Questionvirtual methods in base classes Pin
jon-809-Sep-06 5:34
professionaljon-809-Sep-06 5:34 
AnswerRe: virtual methods in base classes Pin
Jun Du9-Sep-06 6:27
Jun Du9-Sep-06 6:27 
jon_80 wrote:
Shouldn't the compiler call the method in the base class when the method with the same name is not declared as virtual?


No.

Whether mammal's walk() is virtual or not, dog's walk() (if defined) will be called first, becuase fido object is constructed from dog class. And, mammal's walk() will not be called automatically. Virtual or not just controls whether this method can be overridden by the derived class. There is no confusing polymophism stuff here. If you want mammal's walk() to get called, either

1) you have to place it inside dog's walk(), or
2) if mammal's walk() is virtual, cast fido object using a mammal pointer and call walk().

Virtual destructor is an exception, which I assume you already know.



Best,
Jun

AnswerRe: virtual methods in base classes Pin
mostafa_pasha9-Sep-06 12:20
mostafa_pasha9-Sep-06 12:20 
GeneralRe: virtual methods in base classes Pin
Michael Dunn9-Sep-06 17:26
sitebuilderMichael Dunn9-Sep-06 17:26 
AnswerRe: virtual methods in base classes Pin
Michael Dunn9-Sep-06 17:25
sitebuilderMichael Dunn9-Sep-06 17:25 
GeneralRe: virtual methods in base classes Pin
prasad_som10-Sep-06 23:25
prasad_som10-Sep-06 23:25 
QuestionA single dialog box to show all the data from the device using serial port RS-232 Pin
Veeresh Hiremath9-Sep-06 5:21
Veeresh Hiremath9-Sep-06 5:21 
QuestionCan't Open File Pin
Max++9-Sep-06 3:49
Max++9-Sep-06 3:49 
AnswerRe: Can't Open File Pin
Chris Losinger9-Sep-06 4:04
professionalChris Losinger9-Sep-06 4:04 
AnswerRe: Can't Open File Pin
Hamid_RT9-Sep-06 4:50
Hamid_RT9-Sep-06 4:50 
Questionhow to retrieve color of sliders ticks Pin
CWiC9-Sep-06 2:18
CWiC9-Sep-06 2:18 
GeneralRe: how to retrieve color of sliders ticks Pin
prasad_som9-Sep-06 21:07
prasad_som9-Sep-06 21:07 
GeneralRe: how to retrieve color of sliders ticks Pin
CWiC11-Sep-06 6:55
CWiC11-Sep-06 6:55 
Questionany comments about a cache design? Pin
George_George9-Sep-06 2:18
George_George9-Sep-06 2:18 
Questioninheritance Pin
jon-809-Sep-06 0:45
professionaljon-809-Sep-06 0:45 
AnswerRe: inheritance [modified] Pin
ewighell9-Sep-06 0:59
ewighell9-Sep-06 0:59 
GeneralRe: inheritance Pin
toxcct9-Sep-06 2:19
toxcct9-Sep-06 2:19 
QuestionDesperately need your help. A weird problem about CString Pin
ewighell9-Sep-06 0:42
ewighell9-Sep-06 0:42 
AnswerRe: Desperately need your help. A weird problem about CString Pin
Hamid_RT9-Sep-06 1:50
Hamid_RT9-Sep-06 1:50 

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.