home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / cplus / 13535 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  1.5 KB

  1. Path: sparky!uunet!cs.utexas.edu!devnull!thunder.Berkeley.EDU!rjf
  2. From: rjf@thunder.Berkeley.EDU (Russell Fleming)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: pointer typecasting question...
  5. Message-ID: <2425@devnull.mpd.tandem.com>
  6. Date: 11 Sep 92 15:34:30 GMT
  7. References: <1992Sep10.210319.4450@news.columbia.edu>
  8. Sender: news@devnull.mpd.tandem.com
  9. Lines: 26
  10.  
  11. In article <1992Sep10.210319.4450@news.columbia.edu>,
  12. kps@cunixb.cc.columbia.edu (Karthik P Sheka) writes:
  13. > I'm working on a C++ program that is using a C package that is giving
  14. > problems (The package was not meant to be used in C++):
  15. > One C call I make, CreateButton, takes as an arguement, a pointer to a
  16. > function that takes one arguement and returns void:
  17.  
  18.     ... C example deleted ...
  19.  
  20. > When used in a C++ program, I want to send a pointer to an instance of a
  21. > public function.  Unfortunately, this does not work:
  22.     ... C++ example deleted ...
  23.  
  24. This is a FAQ.  Each function of a class (except for static functions)
  25. has an implied first argument which is a pointer to an instance of the
  26. object.  Therefore, a function of a class which has a single int
  27. argument is really a function which has two arguments (a pointer to the
  28. object and an int).  A stand-alone function which has a single int
  29. argument only has the single int argument.
  30.  
  31. =================================================================
  32. Rusty Fleming, Software Consultant @ Tandem Computers Inc.
  33. email: rjf@mpd.tandem.com            Austin, Texas
  34. voice: (512) 244 - 8390              USA
  35.