If it isn't passed by reference it goes to an infinite recursion.

On Wed, Jul 21, 2010 at 12:08 AM, mallesh <[email protected]> wrote:

> In C++  Why is it that copy constructor uses only reference as
> parameter and not the actual class?
> I was given a hint that it has got something to do with stack. I think
> it has got something to do with reentrant functions.
>
> In C also., I think the same thing happens when we pass struct as
> parameter to a function, instead of copying the whole structure on to
> stack, it takes struct variable's address.
>
> Can you please explain why this is so?
>
> -Thanks and regards,
> Mallesh
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to