For the first question answer is 2 copy constructors are called. One when you call foo(*a) and the other when you are assigning object b to *a
On Sun, Jul 4, 2010 at 8:49 PM, sharad <[email protected]> wrote: > 1)void foo(A a){} > A* a =new A(); > foo(*a); > A b=*a; > b=*a; > How many copy ctors of class A are called? > > > 2)When C++ compiler can't generate default = operator for the class? > > 3)what all errors is possible if u write past the array bounds > > -- > 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]<algogeeks%[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.
