Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Function pointer usage in non-member-function



On Sep 30, 2006, at 4:38 AM, John Dalgliesh wrote:

The problem is that 'functionPointer' is not defined within 'helperFunc2'. Which BaseClass instance contains the function pointer that you want to call on 'classPointer'? If it is classPointer itself, then that line should read:
(classPointer->*classPointer->functionPointer)( 7 );

Great, this works :-)

Also, I should say that I'd be surprised if virtual functions didn't eliminate most of your need for function pointers.


Sure, but then I have to rewrite the code in a OO fashion. Currently I just need a quick and dirty method to get things running.


Greetings, Beat

--
Beat ZAHND
Physics Institute
University of Bern                   phone  +41 31 631 3466
Sidlerstrasse 5                      fax    +41 31 631 4405
CH-3012 Bern (Switzerland) mailto:email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-drivers mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-drivers/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.