The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Copy data and send it to other file, with diff config single Shell Programming and Scripting 0 01-29-2008 06:56 AM
scalar variable assignment in perl + { operator JamesGoh Shell Programming and Scripting 3 01-20-2008 02:09 PM
Constructor problem woot4moo UNIX for Dummies Questions & Answers 4 09-05-2006 10:49 PM
copy diff files Hitori UNIX for Advanced & Expert Users 3 07-15-2006 03:53 AM
diff 2 files; output diff's to 3rd file blt123 Shell Programming and Scripting 2 05-28-2002 08:29 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-05-2007
Registered User
 

Join Date: Jul 2007
Posts: 91
what is diff b/w copy constructor and overloaded assignment operator

Helo i m new in c++.
i m confuse about what is exact difference b/w copy constructor and overloaded assignment operator.
Regards,
Amit
Reply With Quote
Forum Sponsor
  #2  
Old 08-06-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
A copy constructor creates a new object as part of the assignment.

An overloaded assignment assigns a value to an existing object.
Reply With Quote
  #3  
Old 08-06-2007
Registered User
 

Join Date: Jul 2007
Posts: 91
Quote:
Originally Posted by porter View Post
A copy constructor creates a new object as part of the assignment.

An overloaded assignment assigns a value to an existing object.
helo i have one more confusion about copy constructor and overloaded assignment operator:
copy constructor make a deep copy i understand this but an overloaded assignment operator make shall copy or deep copy
Regards,
Amit
Reply With Quote
  #4  
Old 08-06-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
In both cases whether a shallow or deep copy is done is dependent on the target class's implementation.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0