943,547 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 307
  • C++ RSS
Feb 6th, 2009
0

copy constructors question

Expand Post »
When a parameter in a function definition (for say class distance) is abc(distance a) and in the main you call this function and pass distance b, what is the relationship thereafter between distance a and b? Do there adresses become equal-if so what implications does that have in the program?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
CPPRULZ is offline Offline
91 posts
since Aug 2008
Feb 6th, 2009
0

Re: copy constructors question

Hi CPPRULZ ,

Might be these links can give you the answers.

1) http://www.codersource.net/cpp_copy_constructors.html

2) http://www.daniweb.com/forums/thread38304.html
Reputation Points: 12
Solved Threads: 7
Light Poster
RenjithVR is offline Offline
41 posts
since Mar 2008
Feb 6th, 2009
0

Re: copy constructors question

Thanks RenjithVR , I now think I understand copy construcotrs better but just 1 more question: when you call abc(diatance b) to a (distance &c) function definition should you rather call abc(distance &b) to (distance &c)?
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
CPPRULZ is offline Offline
91 posts
since Aug 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Very Frustrated with output i'm receiving-TRIG
Next Thread in C++ Forum Timeline: Running C++ program in the background





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC