Click here to Skip to main content
15,889,200 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Modeless dialog box not display in center of parent dialog box. Pin
Iain Clarke, Warrior Programmer15-Apr-09 23:01
Iain Clarke, Warrior Programmer15-Apr-09 23:01 
GeneralRe: Modeless dialog box not display in center of parent dialog box. Pin
Naveen16-Apr-09 17:26
Naveen16-Apr-09 17:26 
QuestionHow to get outlook attachment event? Pin
SNI15-Apr-09 20:01
SNI15-Apr-09 20:01 
AnswerRe: How to get outlook attachment event? Pin
Stuart Dootson15-Apr-09 23:02
professionalStuart Dootson15-Apr-09 23:02 
GeneralRe: How to get outlook attachment event? Pin
SNI17-Apr-09 0:37
SNI17-Apr-09 0:37 
GeneralRe: How to get outlook attachment event? Pin
Stuart Dootson17-Apr-09 0:49
professionalStuart Dootson17-Apr-09 0:49 
GeneralRe: How to get outlook attachment event? Pin
Stuart Dootson17-Apr-09 1:06
professionalStuart Dootson17-Apr-09 1:06 
QuestionPuzzle about c++ inherent Pin
sharion15-Apr-09 19:08
sharion15-Apr-09 19:08 
Here is the code snippet.
class Super
{
public:
    Super(){}
    virtual void someMethod() {cout<<"in Super class"<<endl;}
};

class Sub : public Super
{
public:
    Sub();
    virtual void someMethod(){cout<<"in Sub class"<<endl;}
};

Sub mySub;
Super& ref =mySub;
ref.someMethod(); 

I don't really understand how the compiler works when it comes to the statement ref.someMethod(); . I guess the compiler first find someMethod() method in the Sub class. If doesn't find, then enter base class---Super class to find it.
above explanation is correct?
------------
If altering someMethod() in Sub class like this:

virtual void someMethod(int i){cout<<"in Sub class"<<endl;}<br />

what happens when the compiler runs ref.someMethod(); statement?
Obviously the output is "in Super class".
------------
If the someMethod() in Sub class is

virtual void someMethod(int i = 1){cout<<"in Sub class"<<endl} <br />

when the compiler runs ref.someMethod(); statement,what is the output?
In VS 2005,the output is "in Super class". I feel it is hard to understand,I believe the right result is "in Sub class".

Anyone could give me some idea,thanks in advance.

sharion
AnswerRe: Puzzle about c++ inherent [modified] Pin
_AnsHUMAN_ 15-Apr-09 19:27
_AnsHUMAN_ 15-Apr-09 19:27 
AnswerRe: Puzzle about c++ inherent Pin
ParagPatel15-Apr-09 21:50
ParagPatel15-Apr-09 21:50 
AnswerRe: Puzzle about c++ inherent Pin
Stuart Dootson15-Apr-09 22:51
professionalStuart Dootson15-Apr-09 22:51 
QuestionHow do I remove thousand seperator. Pin
cozyu15-Apr-09 16:06
cozyu15-Apr-09 16:06 
AnswerRe: How do I remove thousand seperator. Pin
Stuart Dootson15-Apr-09 22:47
professionalStuart Dootson15-Apr-09 22:47 
GeneralRe: How do I remove thousand seperator. Pin
Cedric Moonen16-Apr-09 0:00
Cedric Moonen16-Apr-09 0:00 
GeneralRe: How do I remove thousand seperator. Pin
Stuart Dootson16-Apr-09 0:08
professionalStuart Dootson16-Apr-09 0:08 
Question[OT] Re: How do I remove thousand seperator. Pin
David Crow16-Apr-09 3:28
David Crow16-Apr-09 3:28 
AnswerRe: [OT] Re: How do I remove thousand seperator. Pin
Stuart Dootson16-Apr-09 3:32
professionalStuart Dootson16-Apr-09 3:32 
GeneralRe: How do I remove thousand seperator. Pin
cozyu16-Apr-09 16:03
cozyu16-Apr-09 16:03 
QuestionMeasure timing of functions Pin
dybs15-Apr-09 14:33
dybs15-Apr-09 14:33 
AnswerRe: Measure timing of functions Pin
Luc Pattyn15-Apr-09 14:52
sitebuilderLuc Pattyn15-Apr-09 14:52 
AnswerRe: Measure timing of functions Pin
Stuart Dootson15-Apr-09 15:33
professionalStuart Dootson15-Apr-09 15:33 
GeneralRe: Measure timing of functions Pin
dybs15-Apr-09 15:59
dybs15-Apr-09 15:59 
AnswerRe: Measure timing of functions Pin
Jijo.Raj15-Apr-09 22:37
Jijo.Raj15-Apr-09 22:37 
QuestionC++ function source code size Pin
Eureka_jim15-Apr-09 10:35
Eureka_jim15-Apr-09 10:35 
AnswerRe: C++ function source code size Pin
Stuart Dootson15-Apr-09 11:18
professionalStuart Dootson15-Apr-09 11:18 

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.