@teja:

if we use call by value in copy constructor,,

class base
{
int a;
public:
base(int x)
{
a=x;
}

base(base c)
{
}

};

int main()
{
base b(1);
base b1=b;// this ll be seen as base c=b(see the copy constructor)..this ll
in turn call another copy constructor..

return 0;
}

now it ll create a separate object each time you call a copy constructor..so
it ll result in infinite loop..so we have to pass by reference..
On Mon, Sep 19, 2011 at 7:53 PM, teja bala <pawanjalsa.t...@gmail.com>wrote:

> Does anyone can xplain Function object or functor in C++ with
> example???
>
>
> thx in advance.............
>
> --
> 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.
>
>


-- 
*prasanth*

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