Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to make the release version of a visual studio 2008 c++ project so i can step in and debug? Pin
ns29-Sep-10 4:35
ns29-Sep-10 4:35 
GeneralRe: How to make the release version of a visual studio 2008 c++ project so i can step in and debug? Pin
Luc Pattyn29-Sep-10 4:47
sitebuilderLuc Pattyn29-Sep-10 4:47 
Questionmfc xp style Pin
alexander 198328-Sep-10 5:46
alexander 198328-Sep-10 5:46 
AnswerRe: mfc xp style Pin
Moak28-Sep-10 6:31
Moak28-Sep-10 6:31 
AnswerRe: mfc xp style Pin
Paresh Chitte28-Sep-10 20:13
Paresh Chitte28-Sep-10 20:13 
QuestionAccessing a Variable Pin
T.RATHA KRISHNAN27-Sep-10 22:16
T.RATHA KRISHNAN27-Sep-10 22:16 
AnswerRe: Accessing a Variable Pin
Code-o-mat27-Sep-10 22:26
Code-o-mat27-Sep-10 22:26 
AnswerRe: Accessing a Variable Pin
CPallini27-Sep-10 22:32
mveCPallini27-Sep-10 22:32 
T.RATHA KRISHNAN wrote:
I've printed the same variable inside another derived class. But it prints nothing.

? Confused | :confused:

this sample code
#include <iostream>
class A
{
protected:
  int a;
public:
  A(int a):a(a){}
  void show(){ std::cout << "this is A, a=" << a << std::endl;}
};

class B: public A
{

public:
  B(int b):A(b){}
  void show(){ std::cout << "this is B, a=" << a << std::endl;}
};

class C: public B
{

public:
  C(int c):B(c){}
  void show(){ std::cout << "this is C, a=" << a << std::endl;}
};


int main()
{
  A a(3);
  B b(4);
  C c(5);

  a.show();
  b.show();
  c.show();

  return 0;
}



produces:


this is A, a=3
this is B, a=4
this is C, a=5





Smile | :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

AnswerRe: Accessing a Variable Pin
bleedingfingers27-Sep-10 22:40
bleedingfingers27-Sep-10 22:40 
GeneralRe: Accessing a Variable Pin
T.RATHA KRISHNAN27-Sep-10 22:53
T.RATHA KRISHNAN27-Sep-10 22:53 
AnswerRe: Accessing a Variable Pin
AmbiguousName27-Sep-10 23:20
AmbiguousName27-Sep-10 23:20 
AnswerRe: Accessing a Variable Pin
Niklas L27-Sep-10 23:34
Niklas L27-Sep-10 23:34 
GeneralRe: Accessing a Variable Pin
T.RATHA KRISHNAN27-Sep-10 23:50
T.RATHA KRISHNAN27-Sep-10 23:50 
GeneralRe: Accessing a Variable Pin
bleedingfingers28-Sep-10 0:04
bleedingfingers28-Sep-10 0:04 
AnswerRe: Accessing a Variable Pin
bleedingfingers27-Sep-10 23:42
bleedingfingers27-Sep-10 23:42 
GeneralRe: Accessing a Variable Pin
Moak27-Sep-10 23:49
Moak27-Sep-10 23:49 
JokeRe: Accessing a Variable Pin
bleedingfingers28-Sep-10 0:03
bleedingfingers28-Sep-10 0:03 
GeneralRe: Accessing a Variable Pin
T.RATHA KRISHNAN28-Sep-10 0:38
T.RATHA KRISHNAN28-Sep-10 0:38 
QuestionWM_COPYDATA fails with error RPC_E_CANTCALLOUT_ININPUTSYNCCALL [modified] Pin
sashoalm27-Sep-10 21:15
sashoalm27-Sep-10 21:15 
QuestionMutex blocks CreateFileMapping Pin
Maxwell Chen27-Sep-10 20:52
Maxwell Chen27-Sep-10 20:52 
AnswerRe: Mutex blocks CreateFileMapping Pin
Code-o-mat27-Sep-10 22:46
Code-o-mat27-Sep-10 22:46 
GeneralRe: Mutex blocks CreateFileMapping Pin
Maxwell Chen27-Sep-10 22:54
Maxwell Chen27-Sep-10 22:54 
GeneralRe: Mutex blocks CreateFileMapping Pin
Code-o-mat27-Sep-10 23:04
Code-o-mat27-Sep-10 23:04 
GeneralRe: Mutex blocks CreateFileMapping Pin
Maxwell Chen27-Sep-10 23:05
Maxwell Chen27-Sep-10 23:05 
GeneralRe: Mutex blocks CreateFileMapping Pin
Code-o-mat27-Sep-10 23:17
Code-o-mat27-Sep-10 23:17 

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.