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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!taumet!steve
  3. From: steve@taumet.com (Steve Clamage)
  4. Subject: Re: How to call C++ functions in a C program?
  5. Message-ID: <1992Dec18.173559.731@taumet.com>
  6. Organization: TauMetric Corporation
  7. References: <1gqbepINNt6s@function.mps.ohio-state.edu> <1gqe3lINNs1v@eagle.natinst.com>
  8. Date: Fri, 18 Dec 1992 17:35:59 GMT
  9. Lines: 25
  10.  
  11. banshee@natinst.com (Jeff Kellam) writes:
  12.  
  13. >In article <1gqbepINNt6s@function.mps.ohio-state.edu> ren@function.mps.ohio-state.edu (Liming Ren) writes:
  14. >>
  15. >>I know we can call C functions inside a C++ program. Is there a way to
  16. >>call a C++ function inside a C program?
  17.  
  18. >Basically, you can't.
  19.  
  20. Nonsense!  Of course you can.
  21.  
  22. The method is documented in the ARM, in C++PL2 and in Lippman's C++
  23. Primer, just for openers.  It is guaranteed portable, assuming only
  24. that you have a C and a C++ compiler which were intended to be
  25. compatible.  I don't know of any C++ implementations where this is
  26. not the case.
  27.  
  28. Look up "linkage specifier" in any good C++ text.
  29.  
  30. There are a few things to watch out for.  I detailed these in my
  31. article "Linking C++ With Other Languages", in C++ Report,
  32. vol 4, no 4, June 1992.
  33. -- 
  34.  
  35. Steve Clamage, TauMetric Corp, steve@taumet.com
  36.