Click here to Skip to main content
15,911,891 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Adding Items Pin
_AnsHUMAN_ 14-May-06 21:00
_AnsHUMAN_ 14-May-06 21:00 
AnswerRe: Adding Items Pin
Maximilien15-May-06 3:04
Maximilien15-May-06 3:04 
GeneralRe: Adding Items Pin
Hamid_RT15-May-06 4:13
Hamid_RT15-May-06 4:13 
AnswerRe: Adding Items Pin
David Crow15-May-06 6:21
David Crow15-May-06 6:21 
GeneralRe: Adding Items Pin
VinayCool15-May-06 20:40
VinayCool15-May-06 20:40 
GeneralRe: Adding Items Pin
David Crow16-May-06 4:32
David Crow16-May-06 4:32 
QuestionCopy constructor Pin
Scorpio14-May-06 19:36
Scorpio14-May-06 19:36 
AnswerRe: Copy constructor Pin
Nibu babu thomas14-May-06 20:01
Nibu babu thomas14-May-06 20:01 
NiLeSh KoRpE wrote:
Why do i need copy constructor ,in call by value functions.


To copy member values of one object to another object of the same type. To make the copied object's state exactly similar to the original.

So hence you need a copy constructor coz the compiler needs it during such operations.

An eg:
class CopyCons
{
    //....Other constructors
    CopyCons(CopyCons<code>&</code> ccons)
    {
       //code for copying.
    }
}


Note the ampersand in red. It is mandatory for copy constructors that you pass the object to be copied by reference or else it will result in calling the copy constructor again for the same object leading to trouble.


Nibu thomas
Software Developer

Faqs by Michael dunn

AnswerRe: Copy constructor Pin
Alton Williams7-Jun-06 3:06
Alton Williams7-Jun-06 3:06 
QuestionIOCompletion port question about file IO Pin
followait14-May-06 19:03
followait14-May-06 19:03 
QuestionRetrival of from EXE Pin
birajendu14-May-06 18:42
birajendu14-May-06 18:42 
AnswerRe: Retrival of from EXE Pin
Ryan Binns14-May-06 18:58
Ryan Binns14-May-06 18:58 
AnswerRe: Retrival of from EXE Pin
_AnsHUMAN_ 14-May-06 19:00
_AnsHUMAN_ 14-May-06 19:00 
GeneralRe: Retrival of from EXE Pin
birajendu14-May-06 19:12
birajendu14-May-06 19:12 
GeneralRe: Retrival of from EXE Pin
ThatsAlok14-May-06 23:40
ThatsAlok14-May-06 23:40 
QuestionSending Bytes to Activex VC++.Net Pin
satsumatable14-May-06 18:40
satsumatable14-May-06 18:40 
Questionhow to convert series of BMP to a movie(AVI) Pin
ramyasangeet14-May-06 18:38
ramyasangeet14-May-06 18:38 
AnswerRe: how to convert series of BMP to a movie(AVI) Pin
Cool Ju14-May-06 19:06
Cool Ju14-May-06 19:06 
Questionhelp on MFC (urgent) Pin
makaveli_0714-May-06 17:47
makaveli_0714-May-06 17:47 
AnswerRe: help on MFC (urgent) Pin
John M. Drescher14-May-06 18:09
John M. Drescher14-May-06 18:09 
GeneralRe: help on MFC (urgent) Pin
makaveli_0714-May-06 18:24
makaveli_0714-May-06 18:24 
GeneralRe: help on MFC (urgent) Pin
makaveli_0714-May-06 18:31
makaveli_0714-May-06 18:31 
GeneralRe: help on MFC (urgent) Pin
Christian Graus14-May-06 18:59
protectorChristian Graus14-May-06 18:59 
AnswerRe: help on MFC (urgent) Pin
bob1697214-May-06 18:16
bob1697214-May-06 18:16 
GeneralRe: help on MFC (urgent) Pin
makaveli_0714-May-06 18:31
makaveli_0714-May-06 18:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.