I read this in order to do my approach
I have a file: software_pluginInterface.di
Here I declare :
extern (C): void performComputation(char lib[], char func[], void* ptr[], int varNum );
// lib and func will be used later
Then I have the corresponding C file: software_pluginInterface.c, where I declare :
#include "stdio.h"
#include "string.h"
void performComputation(char lib[], char func[], void * v[], int varNum)
{
printf("there are %d variables \n", varNum);
}
Then I call this with :
performComputation(A, B, V, to!int(v.count()/3));
A, B are '\0' terminated char arrarys V is a void pointer array with 6 elements
So I would expect a output like : there are 2 variables
But I am getting : there are 1557197040 variables
I have 64 bit OS, and I compile it all using (as in the other question)
gcc -c software_pluginInterface.c
dmd software.d software_pluginInterface.o
Then I call them using : ./software
PS: according to this page, D ints are same as C ints.
D – Dominance focuses on problems and challenges. I – Influence focuses on people and contacts. S – Steadiness focuses on pace and consistency. C – Conscientious focuses on procedures and constraints.
The DiSC model describes four main styles: D, i, S, and C. D is for Dominance, i is for Influence, S is for Steadiness, and C is for Conscientiousness. Everyone is a mixture of each style, but most people tend to fall into one or two main DiSC style quadrants.
It's tempting to believe that there is one personality type that is better than the rest. However, the truth is that none of the DISC personality types is better or worse than the other.
In D, an array consists of a pointer to some data, and a length, in C++, it's basically just a pointer. This means that your D function should be declared as:
extern (C): void performComputation(char* lib, char* func, void** ptr, int varNum );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With