From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: linux-c-programming@vger.kernel.org
Subject: Re: function pointers in C++
Date: Mon, 15 Mar 2004 11:27:51 +0100 [thread overview]
Message-ID: <20040315102750.GY17857@lug-owl.de> (raw)
In-Reply-To: <1079342899.405577335bb24@webmail.uoa.gr>
[-- Attachment #1: Type: text/plain, Size: 796 bytes --]
On Mon, 2004-03-15 11:28:19 +0200, elathan@phys.uoa.gr <elathan@phys.uoa.gr>
wrote in message <1079342899.405577335bb24@webmail.uoa.gr>:
> Hello!
>
> Suppose I have:
>
> class Foo
> {
> public:
> Foo();
> ~Foo();
> int bar(int);
> };
>
> Now, why I can't do this:
>
> Foo *f = new Foo();
> taz(f->bar);
>
> Where taz()'s protype is:
>
> void taz(int (*f)(int));
You're looking for "static"ally declared member functions.
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de . +49-172-7608481
"Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg
fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak!
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2004-03-15 10:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-15 9:28 function pointers in C++ elathan
2004-03-15 10:27 ` Jan-Benedict Glaw [this message]
2004-03-15 10:39 ` elathan
2004-03-15 14:38 ` Darío Mariani
2004-03-15 14:56 ` Darío Mariani
2004-03-15 19:10 ` Ashutosh Ranjan
-- strict thread matches above, loose matches on Subject: below --
2004-03-15 14:21 Sandro Dangui
2004-03-15 11:28 ` Elias Athanasopoulos
2004-03-16 7:50 ` Glynn Clements
2004-03-18 11:17 ` Elias Athanasopoulos
2004-03-15 21:59 Sandro Dangui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040315102750.GY17857@lug-owl.de \
--to=jbglaw@lug-owl.de \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).