Mixmaster wrote:
>
> Ben Laurie wrote:
> > > rene.eberhard> It't also easy to use C++ objects in a C code.
> > >
> > > Oh? How so? Is that portable?
> >
> > Yes. But boring...
> >
> > extern "C" {
> >
> > void *newThing()
> > {
> > return new Thing;
> > }
>
> That's how to use C in C++ code, not C++ in C code.
> Feed the above to an ANSI C compiler (solaris) and it says
> $ cc -o foo foo.c
> "foo.c", line 2: syntax error before or at: "C"
> "foo.c", line 6: undefined symbol: new
No, you feed it to C++, then call newThing() from C.
Cheers,
Ben.
--
SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm
http://www.apache-ssl.org/ben.html
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]