D for dynamic web pages

Unknown W. Brackets unknown at simplemachines.org
Tue Nov 7 21:25:38 PST 2006


Calling C code in D:

/* C code */
void foo()
{
...
}

/* D code */
extern (C)
void foo();

...

foo();

Calling D code in C:

/* C code */
void foo();

...

foo();

/* D code */
extern (C)
void foo()
{
...
}

But if you pass dynamically allocated pointers, arrays, objects, etc. 
around you have to make sure to keep a reference for the GC.

For searching... something like this?

http://www.google.com/search?q=site%3Adigitalmars.com+inurl%3Apnews%2Fread

-[Unknown]


> Thanks for the input everyone. So there are a few ways to go about this it seems.
> Now I just need to figure out which way would be the best to go.
> 
> On that note, I have a few questions:
> Are there any good guides/tutorials/examples on how to call D code from C and vice
> versa?
> How do you search the D forums here without actually including results from the
> entire site?



More information about the Digitalmars-d-learn mailing list