home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.g++.help
- Path: sparky!uunet!van-bc!ubc-cs!unixg.ubc.ca!kakwa.ucs.ualberta.ca!acs.ucalgary.ca!news
- From: edstrom@Elmer.hsc.ucalgary.ca (John Edstrom)
- Subject: how to do this?
- Message-ID: <92Sep10.203359.4881@acs.ucalgary.ca>
- Sender: news@acs.ucalgary.ca (USENET News System)
- Date: Thu, 10 Sep 92 20:33:59 GMT
- Distribution: gnu
- Nntp-Posting-Host: elmer.hsc.ucalgary.ca
- Organization: Neuroscience Division, U of Calgary School of Medicine, Calgary, Alberta, Canada
- Lines: 30
-
-
-
- I am trying to convert some C++ code to g++. What is wrong with the
- following constructions and how can I do it in g++?
-
- ----------
-
- class a {
- public:
- int x();
- };
-
- int a::x() { return 1; }
-
- main() {
- printf("%x\n", (int(*))a::x);
- }
-
-
- the compiler complains that it cannot convert a::x to a pointer
-
-
- what am I doing wrong?
-
- JE
- --
- RM 2104, HSc Building, Div. Neuroscience
- U. Calgary School of Medicine, 3330 Hospital Drive NW
- Calgary, Alberta T2N 3Y4
- (403) 220 4493 (wk)
-