1. Hey Guest Did you know you can win an Honor 10 phone worth ₹33,000 and an additional ₹70,000 in paytm vouchers, just by replying to some threads and taking part in the discussions happening in the Honor Hub?

    What are you waiting for? Start commenting and start winning! Remember to read the instructions posted here.

    Dismiss Notice

Copy Construcor Help...

Discussion in 'QnA (read only)' started by ymhatre, May 7, 2006.

Thread Status:
Not open for further replies.
  1. ymhatre

    ymhatre New Member

    Joined:
    Jan 4, 2006
    Messages:
    510
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Mumbai, Vile Parle - East
    Guys im not abble to understand cpy constructor in C++...
    Im a rookie in c++ n currently doing engg First year....
    I hav read many of online copy constructor programs but it was of no use.... Confusion still exist
    I want to know basic use of it, how t use it , and wht r its advantages...
    Please explain me this in easy language....
    thnx
     
  2. Jatin_T

    Jatin_T New Member

    Joined:
    Aug 6, 2004
    Messages:
    142
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Behind u with a knife-hehe-Mumbai!!
    Man...for First year engg in Mumbai university..stick to the textboks..dont go online...
    coz we guys r learning really basic stuff..even some wrong stuff..stuff dat has not been in use nowadays
    Neways..get E.Balaguruswamy and study copy constructors
    I dont have my copy lying around..but from what i remember..

    It can be used to create a an object that is a copy of an already defined object..i.e. with class variabled given values.

    Ok..found it..u sure are lucky..it was near my PC..page 139,balaguruswamy:
    a copy constructor is use to declare and initialize an object from anoder object
    i. Integer i2(i1);
    this would define object i2 and initailize its values to dat of i1 variables
    u cud also use integer i2=i1

    this statements wont work if u havent defined a copy constructor.

    i assume u know a constructor integer i3(10,50) wud initialize i3 variables to 10,50..in d copy constructor case..it wud give dem values of the object in the bracket...got it??
    BTW..how does this come under open source??
     
  3. OP
    OP
    ymhatre

    ymhatre New Member

    Joined:
    Jan 4, 2006
    Messages:
    510
    Likes Received:
    2
    Trophy Points:
    0
    Location:
    Mumbai, Vile Parle - East
    Thnx alot jatin....
    it was really help ful....
    but i still want to undergo few more examples...
    problem is i dont hav balguruswamy,
    actually i was confused were to post this thread so i did open source....
    Please if u hav any more examples post here....
    THNX
     
Thread Status:
Not open for further replies.

Share This Page