@amrit
Every non-static member function of a class has an implicit parameter
that is passed to the function (when called) This implicit parameter
is nothing but the "this" pointer. Now if you want to make the
implicit parameter ("this" pointer) a "const", how would u do it? This
is done by placing the "const" keyword at the end of the function
signature.

In case you want to make the "this" pointer "volatile", u can do so by
placing the keyword "volatile" at the end of the function signature.


On May 28, 12:05 am, Manikanta Babu <manikantabab...@gmail.com> wrote:
> 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 <dabbcomput...@gmail.com>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 algogeeks@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/algogeeks?hl=en.
>
> --
> Thanks & Regards,
> Manihttp://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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to