Article View: comp.lang.misc
Article #2393Re: Pointers
From: Markku Sakkinen
Date: Fri, 13 Nov 1992 07:28
Date: Fri, 13 Nov 1992 07:28
39 lines
2175 bytes
2175 bytes
In article <1dujcuINNru4@early-bird.think.com> barmar@think.com (Barry Margolin) writes:
> ...
>C's function pointers are almost exactly like the procedure variables that
>many other languages have. As in many other aspects, C has overloaded an
Indeed, I have always found it helpful to think of procedure variables
in languages like Modula-2 as actually being only pointers to procedures,
since no other operations are applicable to them than those
of pointer variables.
> ...
>case the indirection isn't required. You can't cast between them and
>non-function pointers.
In K&R C you could (char*), and in C++ you can (void*).
...
>they specified the declaration syntax accordingly. But when you look at
>C++ and its member function pointers, you see that these are more like the
>traditional procedure variables (the environment in this case is the "self"
>object); however, they've kept C's function "pointer" syntax for declaring
>them.
Actually, they are farther away from traditional procedure variables
than are ordinary function pointers. A "member function pointer" is more
like an offset: it does not by itself designate an object, and not even a
specific function in the case of virtual functions (dynamic binding
occurs, depending on the actual class of the object with which
the "member function pointer" is applied).
----------------------------------------------------------------------
Markku Sakkinen (sakkinen@jytko.jyu.fi)
SAKKINEN@FINJYU.bitnet (alternative network address)
Department of Computer Science and Information Systems
University of Jyvaskyla (a's with umlauts)
PL 35
SF-40351 Jyvaskyla (umlauts again)
Finland
----------------------------------------------------------------------
Technical Details
Message-ID:
<1992Nov13.072834.4673@jyu.fi>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!news.funet.fi!network.jyu.fi!sakkinenReferences:
<BxJzzv.4H7@mentor.cc.purdue.edu> <721539019@sheol.UUCP> <1dujcuINNru4@early-bird.think.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.misc Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!news.funet.fi!network.jyu.fi!sakkinen From: sakkinen@jyu.fi (Markku Sakkinen) Subject: Re: Pointers Message-ID: <1992Nov13.072834.4673@jyu.fi> Organization: University of Jyvaskyla, Finland References: <BxJzzv.4H7@mentor.cc.purdue.edu> <721539019@sheol.UUCP> <1dujcuINNru4@early-bird.think.com> Date: Fri, 13 Nov 1992 07:28:34 GMT Lines: 39