mockers
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Constrcutor:Bhagalpur SIr

4 posters

Go down

Constrcutor:Bhagalpur SIr Empty Constrcutor:Bhagalpur SIr

Post  ballu Sun Feb 01, 2009 10:35 pm

If there is class
class ABC
{
public:
{
ABC(ABC x)
{

}
}
Is there a problem in this code??
give reason
ballu
ballu

Posts : 58
Join date : 2009-02-01

Back to top Go down

Constrcutor:Bhagalpur SIr Empty Re: Constrcutor:Bhagalpur SIr

Post  ramthegreatcv Mon Feb 02, 2009 12:53 am


  1. Argument of copy constructor should be a reference/pointer
  2. A default constructor has to be created explicitly by the user because we have created a copy constructor
  3. The parentheses after the public: access specifier have to be removed.
ramthegreatcv
ramthegreatcv

Posts : 55
Join date : 2009-01-30
Age : 35

Back to top Go down

Constrcutor:Bhagalpur SIr Empty @RAM P

Post  ballu Mon Feb 02, 2009 2:02 am

but why exactly does this fail???
ballu
ballu

Posts : 58
Join date : 2009-02-01

Back to top Go down

Constrcutor:Bhagalpur SIr Empty Re: Constrcutor:Bhagalpur SIr

Post  mnnit.rahul Mon Feb 02, 2009 2:55 am

kaunsi condition par fail ki baat kar rahe ho????

1st condition fails because this cause the constructor to call recursively

mnnit.rahul

Posts : 51
Join date : 2009-02-01

Back to top Go down

Constrcutor:Bhagalpur SIr Empty @ballu

Post  shivang Mon Feb 02, 2009 4:02 am

etawah is right..it's calling the constructor recursively so it's fail......
shivang
shivang

Posts : 42
Join date : 2009-01-30
Age : 35

Back to top Go down

Constrcutor:Bhagalpur SIr Empty Re: Constrcutor:Bhagalpur SIr

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum