Click here to Skip to main content
15,892,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: Copy constructor Pin
Alton Williams7-Jun-06 3:06
Alton Williams7-Jun-06 3:06 
Nibu thomas wrote:
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.

Because it calls by value which makes a copy of the object which a copy constructor does so you'll get an infine call to a copy constructor, which will hang your system!
NiLeSh KoRpE wrote:
Why do i need copy constructor ,in call by value functions.

NEVER!
a copy constuctor and is supplied by the compiler
it should be used when you have a property that allocates memory.
in in such a case it is beneficial to overide the assignment operator.
And a destructor (C++ does not do automatic memory management, like Java).
Also another another constructor (it's got to copy something)
e.g.

class foo{
public:
   foo(); //default ctor
   ~foo(); //dtor
   foo(const foo &source); //copy ctor
   foo& operator =(const foo &source); //overloading assingment operator
private:
   baz *m_data; // pointer to sometjhing of type baz
};

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 
QuestionRe: help on MFC (urgent) Pin
David Crow15-May-06 6:25
David Crow15-May-06 6:25 

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.