Click here to Skip to main content
15,911,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to get the length of a byte pointer ? Pin
kapardhi11-Mar-09 0:03
kapardhi11-Mar-09 0:03 
AnswerRe: How to get the length of a byte pointer ? Pin
«_Superman_»11-Mar-09 0:09
professional«_Superman_»11-Mar-09 0:09 
AnswerRe: How to get the length of a byte pointer ? Pin
Code-o-mat11-Mar-09 0:36
Code-o-mat11-Mar-09 0:36 
QuestionA small dbt Pin
Cool_Phillip10-Mar-09 23:43
Cool_Phillip10-Mar-09 23:43 
AnswerRe: A small dbt Pin
Stephen Hewitt10-Mar-09 23:47
Stephen Hewitt10-Mar-09 23:47 
GeneralRe: A small dbt Pin
Cool_Phillip11-Mar-09 2:31
Cool_Phillip11-Mar-09 2:31 
AnswerRe: A small dbt Pin
«_Superman_»11-Mar-09 0:13
professional«_Superman_»11-Mar-09 0:13 
AnswerRe: A small dbt Pin
Eytukan11-Mar-09 1:41
Eytukan11-Mar-09 1:41 
In case if you are trying for chain of events, I'd suggest the below one. I just typed it for fun, so don't look at the convections Wink | ;)
class base
{
 public:
 base* m_p;
 std::string m_st;
 base(std::string st):m_st(st),m_p(NULL)
 {
 
 }
 void setRoot(base* p)  
 {
  m_p = p;
 }
 void execute()
 {
   cout<<m_st.c_str()<<endl;
   if(m_p)
   {  m_p->execute();}
 }
};


You don't need to derive & create a separate classe, just try this:

base b("Code");
base b2("Project");
base b3("Bob");

b2.setRoot(&b);
b3.setRoot(&b2);
b3.execute();

might look like the responsibility pattern, but not exactly, it's Vunic's custom patter Wink | ;) .

He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus

Questionsoundex algorithm Pin
priyanka narkhede10-Mar-09 22:51
priyanka narkhede10-Mar-09 22:51 
AnswerRe: soundex algorithm Pin
CPallini10-Mar-09 22:56
mveCPallini10-Mar-09 22:56 
AnswerRe: soundex algorithm Pin
Cedric Moonen10-Mar-09 23:10
Cedric Moonen10-Mar-09 23:10 
AnswerRe: soundex algorithm Pin
Stuart Dootson10-Mar-09 23:14
professionalStuart Dootson10-Mar-09 23:14 
Questionusing CCheckListBox Pin
siva45510-Mar-09 21:51
siva45510-Mar-09 21:51 
AnswerRe: using CCheckListBox Pin
Hamid_RT10-Mar-09 21:59
Hamid_RT10-Mar-09 21:59 
GeneralRe: using CCheckListBox Pin
siva45510-Mar-09 22:45
siva45510-Mar-09 22:45 
NewsOpen source my OIOIC, a completely new object-oriented mechanism for the C. Pin
pervise.zhao10-Mar-09 20:34
pervise.zhao10-Mar-09 20:34 
GeneralRe: Open source my OIOIC, a completely new object-oriented mechanism for the C. Pin
Cedric Moonen10-Mar-09 21:06
Cedric Moonen10-Mar-09 21:06 
GeneralRe: Open source my OIOIC, a completely new object-oriented mechanism for the C. - Voted to remove. Pin
Iain Clarke, Warrior Programmer10-Mar-09 23:02
Iain Clarke, Warrior Programmer10-Mar-09 23:02 
GeneralRe: Open source my OIOIC, a completely new object-oriented mechanism for the C. - Voted to remove. Pin
CPallini10-Mar-09 23:39
mveCPallini10-Mar-09 23:39 
GeneralRe: Open source my OIOIC, a completely new object-oriented mechanism for the C. Pin
CPallini10-Mar-09 23:14
mveCPallini10-Mar-09 23:14 
QuestionCreating a file of fixed size Pin
Raj-Ekoham DwitiyoNasti10-Mar-09 17:38
Raj-Ekoham DwitiyoNasti10-Mar-09 17:38 
AnswerRe: Creating a file of fixed size Pin
Eytukan10-Mar-09 18:40
Eytukan10-Mar-09 18:40 
AnswerRe: Creating a file of fixed size Pin
«_Superman_»10-Mar-09 18:57
professional«_Superman_»10-Mar-09 18:57 
AnswerRe: Creating a file of fixed size Pin
CPallini10-Mar-09 19:51
mveCPallini10-Mar-09 19:51 
GeneralRe: Creating a file of fixed size Pin
Hamid_RT10-Mar-09 22:02
Hamid_RT10-Mar-09 22:02 

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.