top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

C++: Why a copy constructor can not use pointer in place of reference variable ?

+1 vote
567 views
C++: Why a copy constructor can not use pointer in place of reference variable ?
posted Sep 9, 2016 by Neelam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Hi Neelam,

Just to clear your doubt, pointer can be used in used for copy constructor but prefer to use reference variable since it is considered as constant pointer.

answer Sep 11, 2016 by Rupam
Thanks Rupam for your input. After posting this query, I wrote a copy constructor with pointer variable and it compiled successfully.
...