home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!walter!qualcom.qualcomm.com!pbender.qualcomm.com!user
- From: pbender@qualcomm.com (Paul Bender)
- Subject: Address of Member Functions
- Message-ID: <pbender-250193124301@pbender.qualcomm.com>
- Followup-To: comp.lang.c++
- Sender: news@qualcomm.com
- Nntp-Posting-Host: pbender.qualcomm.com
- Organization: QUALCOMM, Incorporated
- Date: Mon, 25 Jan 1993 20:47:04 GMT
- Lines: 28
-
- Is there a reason why this will not valid?
-
- class X {
- private:
- void g1(void);
- void (*g)(void);
- public:
- X(void);
- void f(void);
- };
-
- void X::f(void)
- {
- g = &g1; // line 12
- }
-
- main(void)
- {
- X x;
- }
-
- When I compile it using g++, I get the following error message:
- test.C:14: assignment between incompatible pointer types
-
- ------------------------------------------------------------------------------
- Paul E. Bender | The opinions are my own and should not be
- pbender@qualcomm.com | unfavorably attributed to anyone else.
- ------------------------------------------------------------------------------
-