Message-ID: <003e01bde620$4b080280$866195cc@uic> From: "Andrew Deren" To: "BDozer" , Subject: Re: OO question Date: Tue, 22 Sep 1998 06:58:19 -0500 Precedence: bulk >Is this possible? >for example here's a class: > >//////////// >class CLS >{ >public: >int x,y; >..... >void OnMouseClick(void); >}; >//////////// > >Can I assign other function to a method? Something like: > >//////////// >void MyFunc() >{ >..... >} > >CLS object; >object.OnMouseClick = MyFunc(); (?) >//////////// > No you can't. But you can have a pointer to a function that is called inside OnMouseClick ex. class Object { public: int x, y; ... void OnMouseClick(void) { &click_callback; } void (*click_callback)(void); }; void MyFunc() { ... } Object object; object.click_callback = MyFunc(); > > > >