Click here to Skip to main content
15,901,426 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: SMS Sending programme Pin
Garth J Lancaster10-Dec-09 1:03
professionalGarth J Lancaster10-Dec-09 1:03 
QuestionIs STL string can be used in multithreading application ? Pin
Member 67757439-Dec-09 1:01
Member 67757439-Dec-09 1:01 
AnswerRe: Is STL string can be used in multithreading application ? Pin
mav@octaval9-Dec-09 1:05
mav@octaval9-Dec-09 1:05 
GeneralRe: Is STL string can be used in multithreading application ? Pin
Member 67757439-Dec-09 1:37
Member 67757439-Dec-09 1:37 
AnswerRe: Is STL string can be used in multithreading application ? Pin
Nemanja Trifunovic9-Dec-09 5:26
Nemanja Trifunovic9-Dec-09 5:26 
QuestionHow could I add print facility to Analogmeter Control Pin
ganesh.dp9-Dec-09 0:56
ganesh.dp9-Dec-09 0:56 
GeneralRe: How could I add print facility to Analogmeter Control Pin
CPallini9-Dec-09 1:54
mveCPallini9-Dec-09 1:54 
QuestionDynamic Dispatch Pin
hrishiS8-Dec-09 23:16
hrishiS8-Dec-09 23:16 
Hi to All,


Could you please clear my following doubt.
I have 3 class with multilevel inheritance as follows,,...

class A
{
public:
     A()
     {
          s();
     }
     virtual void s()
     {
          printf("\nIn A");
     }
};
class B:public A
{
     public:
};
class C:public B
{
     public:
          void s()
          {
               printf("\nIn C");
          }
};


int   main(int argc, char* argv[])
{
    
A *ptr     =     new C();
}


when i create an object of C,...by theory it should call always the method S of C....am I correct?...but when I called C from A's constructor Its calling S() of C....Why so?...Could anyone please explain me the reason and some points on it??


thanks in advance

-----------------------------
I am a beginner

AnswerRe: Dynamic Dispatch Pin
Cedric Moonen8-Dec-09 23:24
Cedric Moonen8-Dec-09 23:24 
GeneralRe: Dynamic Dispatch Pin
Stuart Dootson8-Dec-09 23:59
professionalStuart Dootson8-Dec-09 23:59 
AnswerRe: Dynamic Dispatch Pin
hema_soft8-Dec-09 23:30
hema_soft8-Dec-09 23:30 
AnswerRe: Dynamic Dispatch Pin
Stuart Dootson9-Dec-09 0:04
professionalStuart Dootson9-Dec-09 0:04 
QuestionTwain endorse text Pin
sujtha8-Dec-09 22:26
sujtha8-Dec-09 22:26 
AnswerRe: Twain endorse text Pin
Rajesh R Subramanian8-Dec-09 22:36
professionalRajesh R Subramanian8-Dec-09 22:36 
QuestionTwain endorse text [modified] Pin
hema_soft8-Dec-09 23:02
hema_soft8-Dec-09 23:02 
QuestionSetDIBitsToDevice problem Pin
sashoalm8-Dec-09 21:12
sashoalm8-Dec-09 21:12 
AnswerRe: SetDIBitsToDevice problem Pin
Chris Losinger9-Dec-09 9:36
professionalChris Losinger9-Dec-09 9:36 
AnswerRe: SetDIBitsToDevice problem Pin
Rozis9-Dec-09 11:34
Rozis9-Dec-09 11:34 
QuestionConneting to a computer using socket Pin
bubuzzz8-Dec-09 20:21
bubuzzz8-Dec-09 20:21 
AnswerRe: Conneting to a computer using socket Pin
CPallini8-Dec-09 21:11
mveCPallini8-Dec-09 21:11 
GeneralRe: Conneting to a computer using socket Pin
bubuzzz8-Dec-09 22:07
bubuzzz8-Dec-09 22:07 
GeneralRe: Conneting to a computer using socket Pin
CPallini8-Dec-09 22:13
mveCPallini8-Dec-09 22:13 
GeneralRe: Conneting to a computer using socket Pin
Moak12-Dec-09 4:27
Moak12-Dec-09 4:27 
AnswerRe: Conneting to a computer using socket Pin
Moak9-Dec-09 2:31
Moak9-Dec-09 2:31 
GeneralRe: Conneting to a computer using socket Pin
bubuzzz10-Dec-09 21:51
bubuzzz10-Dec-09 21:51 

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.