0

Can object be passed by reference to constructor?

Can object be passed by reference to constructor?

25th Feb 2017, 12:52 PM
Srikanth Srinivasan
Srikanth Srinivasan - avatar
2 Respuestas
+ 3
yes. See copy constructor always takes object by reference.
25th Feb 2017, 12:54 PM
Megatron
Megatron - avatar
+ 1
you can imagine objects like variables, so yes, just like variables can pass by reference so objects can be.
8th Mar 2017, 5:16 AM
Rax
Rax - avatar