home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!taumet!steve
- From: steve@taumet.com (Steve Clamage)
- Subject: Re: How to call C++ functions in a C program?
- Message-ID: <1992Dec18.173559.731@taumet.com>
- Organization: TauMetric Corporation
- References: <1gqbepINNt6s@function.mps.ohio-state.edu> <1gqe3lINNs1v@eagle.natinst.com>
- Date: Fri, 18 Dec 1992 17:35:59 GMT
- Lines: 25
-
- banshee@natinst.com (Jeff Kellam) writes:
-
- >In article <1gqbepINNt6s@function.mps.ohio-state.edu> ren@function.mps.ohio-state.edu (Liming Ren) writes:
- >>
- >>I know we can call C functions inside a C++ program. Is there a way to
- >>call a C++ function inside a C program?
-
- >Basically, you can't.
-
- Nonsense! Of course you can.
-
- The method is documented in the ARM, in C++PL2 and in Lippman's C++
- Primer, just for openers. It is guaranteed portable, assuming only
- that you have a C and a C++ compiler which were intended to be
- compatible. I don't know of any C++ implementations where this is
- not the case.
-
- Look up "linkage specifier" in any good C++ text.
-
- There are a few things to watch out for. I detailed these in my
- article "Linking C++ With Other Languages", in C++ Report,
- vol 4, no 4, June 1992.
- --
-
- Steve Clamage, TauMetric Corp, steve@taumet.com
-