folks during temporary object creation constructor is called right..........but constructor is called here only 2 times.. According to me,either copy constructor and constructor should have been called 2 times both or constructor 4 times ......but its neither of them...paradox
On Sun, Aug 21, 2011 at 9:46 PM, Abhishek Yadav <[email protected]>wrote: > @jagannath: no its not i am totally confused. > > > On Sun, Aug 21, 2011 at 5:57 PM, priya ramesh < > [email protected]> wrote: > >> it is not an error. >> >> check this code: I compiled it >> >> >> #include<iostream> >> using namespace std; >> >> class X >> { >> public: >> X() >> { >> } >> }; >> main(){ >> >> } >> >> X fun() >> { >> return X(); >> } >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
