|
-
September 1st, 2009, 09:37 AM
#1
Basic Question from newbie... - Copy Constructors
Hi everyone,
First post on this forum so hope this is in the right place, please advise if not.
I'm relatively new to C++ and have been trying to test my knowledge with some online tests. I'm a little stuck on one question about copy constructors and in exactly what situations they are invoked, can anyone shed any light on which of the following they are used:
1 - When an existing object is assigned an object of its own class
2 - When a function receives as an argument, an object of the class by value
3 - When no conversion function exists for converting the class to another class object
4 - When a function returns an object to the class by value
5 - When creating an object and initialising it with an object of its own class
I think it would be in called in 2 and not in 4 but other than that I'm unsure, any help appreciated!
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|