| |
GeekInterview.com > Interview Questions > Programming > C++
| Print | |
Question: what is importance of const. pointer in copy constructor?
|
| August 08, 2006 12:59:42 |
#3 |
| Anurag Verma |
Member Since: Visitor Total Comments: N/A |
RE: what is importance of const. pointer in copy const... |
| Copy constructor is called when the copy of an object is made. One of the case is when a function argument is passed by value. So if the signature of copy constructor will take the argument by value it will get into an infinite loop. So a reference is passed and it is made constant to remain unchanged in the copy constructor. |
| |
Back To Question | |