Click here to Skip to main content
15,886,732 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Add support for Memory leak detection Pin
Hamid_RT11-Jun-09 21:32
Hamid_RT11-Jun-09 21:32 
Questionsegmentation problem Pin
sandeep_dhruwa11-Jun-09 19:31
sandeep_dhruwa11-Jun-09 19:31 
AnswerRe: segmentation problem Pin
Cedric Moonen11-Jun-09 20:13
Cedric Moonen11-Jun-09 20:13 
GeneralRe: segmentation problem Pin
sandeep_dhruwa11-Jun-09 21:06
sandeep_dhruwa11-Jun-09 21:06 
GeneralRe: segmentation problem Pin
Cedric Moonen11-Jun-09 21:11
Cedric Moonen11-Jun-09 21:11 
GeneralRe: segmentation problem Pin
sandeep_dhruwa11-Jun-09 23:51
sandeep_dhruwa11-Jun-09 23:51 
AnswerRe: segmentation problem Pin
CPallini11-Jun-09 21:25
mveCPallini11-Jun-09 21:25 
QuestionCall to a constructor while executing (obj < 3) . Kindly explain? Pin
Member 397434711-Jun-09 18:01
Member 397434711-Jun-09 18:01 
class CA{
  private:
    int m_Var;
  public:
        CA(int x=0): m_Var(x){cout<<"1";}
        bool operator < (const CA &obj2) {     cout<<"2";       return (m_Var < obj2.m_Var) ? true : false;}
};
int main(void) {
  CA obj1=2;
  if(obj1 < 3){cout << "In If block" << endl;}
}


the output of this code is 112In If block .. i can understand the reason behind the first 1 and "2In If block" .. i dont understand when the second 1 is being called?

as per my understanding when (obj1<3) executes it may call obj1.operator<(3)

But constructor is being called but whats makes it to call?
kindly explain why the second 1 is being displayed?
AnswerRe: Call to a constructor while executing (obj &lt; 3) . Kindly explain? Pin
Naveen11-Jun-09 18:18
Naveen11-Jun-09 18:18 
GeneralRe: Call to a constructor while executing (obj &lt; 3) . Kindly explain? Pin
N a v a n e e t h11-Jun-09 18:23
N a v a n e e t h11-Jun-09 18:23 
JokeRe: Call to a constructor while executing (obj &lt; 3) . Kindly explain? Pin
Naveen11-Jun-09 18:26
Naveen11-Jun-09 18:26 
GeneralRe: Call to a constructor while executing (obj &lt; 3) . Kindly explain? Pin
Member 397434711-Jun-09 18:28
Member 397434711-Jun-09 18:28 
AnswerRe: Call to a constructor while executing (obj &lt; 3) . Kindly explain? Pin
N a v a n e e t h11-Jun-09 18:22
N a v a n e e t h11-Jun-09 18:22 
GeneralRe: Call to a constructor while executing (obj &lt; 3) . Kindly explain? Pin
Member 397434711-Jun-09 18:38
Member 397434711-Jun-09 18:38 
Questionneed help on liked error Pin
vigneshvdm11-Jun-09 16:50
vigneshvdm11-Jun-09 16:50 
AnswerRe: need help on liked error Pin
CPallini11-Jun-09 21:36
mveCPallini11-Jun-09 21:36 
QuestionHow to get ip address of current socket Pin
cozyu11-Jun-09 16:10
cozyu11-Jun-09 16:10 
AnswerRe: How to get ip address of current socket Pin
yifanernei11-Jun-09 17:02
yifanernei11-Jun-09 17:02 
Questionc programing project on rejistration Pin
seiyfu yesuf11-Jun-09 12:04
seiyfu yesuf11-Jun-09 12:04 
AnswerRe: c programing project on rejistration Pin
molesworth11-Jun-09 12:13
molesworth11-Jun-09 12:13 
AnswerRe: c programing project on rejistration Pin
Rajesh R Subramanian11-Jun-09 12:55
professionalRajesh R Subramanian11-Jun-09 12:55 
AnswerRe: c programing project on rejistration Pin
chirag_chauhan11-Jun-09 18:00
chirag_chauhan11-Jun-09 18:00 
QuestionReduce the noise in the program Pin
Nikhil_777711-Jun-09 11:27
Nikhil_777711-Jun-09 11:27 
AnswerRe: Reduce the noise in the program Pin
Nikhil_777711-Jun-09 11:28
Nikhil_777711-Jun-09 11:28 
AnswerRe: Reduce the noise in the program Pin
Michael Schubert12-Jun-09 0:00
Michael Schubert12-Jun-09 0:00 

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.