Its a const member function, you cant return reference to the object.

Const member function never allows you to modify the data until unless its
a mutable. So here we are passing the reference to object which is
modifiable, it conflicts with the const member function property.

So the compiler throws an error here.

Thanks
Mani

On Mon, May 28, 2012 at 12:23 AM, amrit harry <[email protected]>wrote:

> complex_number const & operator =(complex_number & temp) const
>     {
>     return *this;
>     }
>
>
> what is the job of marked 'const'....???
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/algogeeks/-/zjDLCIDr_p8J.
> 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.
>



-- 
Thanks & Regards,
Mani
http://www.sanidapa.com - The music Search engine

-- 
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