delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/10/13:53:10

From: S2200253 AT nickel DOT laurentian DOT ca
Date: Tue, 10 Jun 1997 13:52:17 +0000 (*)
Subject: copy constructor
To: djgpp AT delorie DOT com
Message-id: <01IJWRH12I828ZPPGT@NICKEL.LAURENTIAN.CA>
MIME-version: 1.0

I'm trying to refine my understanding of the copy constructor and would
like some clarification about it.

Give a class called "Bozo".

Bozo b; // creates a Bozo object
Bozo anotherBozo(b);  // calls the copy constructor
Bozo yetanotherBozo = b;  // does this also call the copy constructor?

Also the Bozo copy constructor would be Bozo::Bozo(Bozo &)  Is this
correct?

Timothy Robb

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019