home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 18183 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.0 KB  |  31 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!umn.edu!myria.cs.umn.edu!hansen
  3. From: hansen@myria.cs.umn.edu (David Hansen)
  4. Subject: Re: How to call C++ functions in a C program?
  5. Message-ID: <1992Dec18.145149.16160@news2.cis.umn.edu>
  6. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  7. Nntp-Posting-Host: myria.cs.umn.edu
  8. Organization: University of Minnesota
  9. References: <1gqbepINNt6s@function.mps.ohio-state.edu> <SCHOUTEN.92Dec17125550@sp95.csrd.uiuc.edu>
  10. Date: Fri, 18 Dec 1992 14:51:49 GMT
  11. Lines: 18
  12.  
  13. In article <SCHOUTEN.92Dec17125550@sp95.csrd.uiuc.edu>, schouten@sp95.csrd.uiuc.edu (Dale Schouten) writes:
  14. |> 
  15. |> I'm not sure how standard it is, but with at least some compilers
  16. [..]
  17. |> extern "C" {
  18. |> int Cplusplus_function(int,char *);
  19. |> }
  20. |> 
  21.  
  22. Pretty standard.  See the ARM, sections 7.4 and 7.1c.  In the above example,
  23. you could also use the form:
  24.  
  25.    extern "C" int Cplusplus_function(int i_parm, char * p_parm)
  26.    {
  27.       // C++ code to implement function
  28.    }
  29.  
  30.                     -=Dave
  31.