home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / cplus / 13529 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.2 KB  |  35 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!wupost!m.cs.uiuc.edu!sunb10.cs.uiuc.edu!sparc10.cs.uiuc.edu!pjl
  3. From: pjl@sparc10.cs.uiuc.edu (Paul Lucas)
  4. Subject: Re: pointer typecasting question...
  5. Message-ID: <1992Sep11.140416.6862@sunb10.cs.uiuc.edu>
  6. Sender: news@sunb10.cs.uiuc.edu
  7. Organization: University of Illinois at Urbana-Champaign
  8. References: <1992Sep10.210319.4450@news.columbia.edu>
  9. Distribution: usa
  10. Date: Fri, 11 Sep 1992 14:04:16 GMT
  11. Lines: 22
  12.  
  13. In <1992Sep10.210319.4450@news.columbia.edu> kps@cunixb.cc.columbia.edu (Karthik P Sheka) writes:
  14.  
  15. >I'm working on a C++ program that is using a C package that is giving
  16. >problems (The package was not meant to be used in C++):
  17.  
  18. >One C call I make, CreateButton, takes as an arguement, a pointer to a
  19. >function that takes one arguement and returns void:
  20.  
  21. >void function(int arguement);
  22. >main()
  23. >{
  24. >    CreateButton(function);
  25. >}
  26.  
  27. [ ... other stuff on using a member-function as a callback elided... ]
  28.  
  29. *****>    A pointer-to-member is _not_ an ordinary pointer; rather it's
  30.     an offset.  So "no" you can't do this.  This is a very FAQ.
  31. -- 
  32.     - Paul J. Lucas                University of Illinois    
  33.       AT&T Bell Laboratories        at Urbana-Champaign
  34.       Naperville, IL            pjl@cs.uiuc.edu
  35.