On 6/12/2014 12:17 AM, Colin wrote:
So a find an replace will do that for you quite easily.
Other things like structs and typedefs are a bit more difficult
to do with a find replace.
All the info you need is here anyway:
wiki.dlang.org/Bind_D_to_C
And here:
Example: I have this C function that is compiled into a library
//File: factorial.h
int factorial(int n);
//File: factorial.c
#include factorial.h
int factorial(int n)
{
if(n!=1)
return n*factorial(n-1);
}
Question: How do I use it from D?
On Wednesday, 11 June 2014 at 13:52:09 UTC, belkin wrote:
Example: I have this C function that is compiled into a library
//File: factorial.h
int factorial(int n);
//File: factorial.c
#include factorial.h
int factorial(int n)
{
if(n!=1)
return n*factorial(n-1);
}
Question: How do I
On Wednesday, 11 June 2014 at 13:52:09 UTC, belkin wrote:
Question: How do I use it from D?
Write the prototype in your D file with extern(C):
extern(C) int factorial(int n);
then just call the function normally in D. Make sure you include
all the C object files when you compile the D
On 06/11/2014 03:54 PM, Adam D. Ruppe wrote:
On Wednesday, 11 June 2014 at 13:52:09 UTC, belkin wrote:
Question: How do I use it from D?
Write the prototype in your D file with extern(C):
extern(C) int factorial(int n);
then just call the function normally in D. Make sure you include all
On Wednesday, 11 June 2014 at 14:02:08 UTC, John Colvin wrote:
On Wednesday, 11 June 2014 at 13:52:09 UTC, belkin wrote:
Example: I have this C function that is compiled into a library
//File: factorial.h
int factorial(int n);
//File: factorial.c
#include factorial.h
int factorial(int n)
{
On Wednesday, 11 June 2014 at 14:11:04 UTC, simendsjo wrote:
I believe the correct answer should be Buy my book!.
ah, of course! I should just make a .sig file lol
http://www.packtpub.com/discover-advantages-of-programming-in-d-cookbook/book
chapter 4 talks about this kind of thing :P
On Wednesday, 11 June 2014 at 14:22:51 UTC, Adam D. Ruppe wrote:
On Wednesday, 11 June 2014 at 14:11:04 UTC, simendsjo wrote:
I believe the correct answer should be Buy my book!.
ah, of course! I should just make a .sig file lol
On 06/11/2014 04:22 PM, Adam D. Ruppe wrote:
On Wednesday, 11 June 2014 at 14:11:04 UTC, simendsjo wrote:
I believe the correct answer should be Buy my book!.
ah, of course! I should just make a .sig file lol
http://www.packtpub.com/discover-advantages-of-programming-in-d-cookbook/book
On Wednesday, 11 June 2014 at 14:28:49 UTC, belkin wrote:
On Wednesday, 11 June 2014 at 14:02:08 UTC, John Colvin wrote:
On Wednesday, 11 June 2014 at 13:52:09 UTC, belkin wrote:
Example: I have this C function that is compiled into a
library
//File: factorial.h
int factorial(int n);
On Wednesday, 11 June 2014 at 15:14:19 UTC, Colin wrote:
On Wednesday, 11 June 2014 at 14:28:49 UTC, belkin wrote:
On Wednesday, 11 June 2014 at 14:02:08 UTC, John Colvin wrote:
On Wednesday, 11 June 2014 at 13:52:09 UTC, belkin wrote:
Example: I have this C function that is compiled into a
On Wednesday, 11 June 2014 at 14:28:49 UTC, belkin wrote:
On Wednesday, 11 June 2014 at 14:02:08 UTC, John Colvin wrote:
On Wednesday, 11 June 2014 at 13:52:09 UTC, belkin wrote:
Example: I have this C function that is compiled into a
library
//File: factorial.h
int factorial(int n);
On 11/06/14 16:22, Adam D. Ruppe via Digitalmars-d-learn wrote:
On Wednesday, 11 June 2014 at 14:11:04 UTC, simendsjo wrote:
I believe the correct answer should be Buy my book!.
ah, of course! I should just make a .sig file lol
On Wednesday, 11 June 2014 at 14:45:22 UTC, simendsjo wrote:
I must say I really like your writing-style as well as the
down-to-earth and precise and concise presentation of the
material. So kudos to you!
thanks, don't forget to tell that to amazon review readers too :P
Really looking
14 matches
Mail list logo