Re: Passing string array to C

2020-09-10 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 10 September 2020 at 15:41:17 UTC, Adam D. Ruppe wrote: On Thursday, 10 September 2020 at 14:31:41 UTC, Andre Pany wrote: [...] You messed up the pointers. [...] Fantastic, thank you so much Adam. Kind regards André

Re: Passing string array to C

2020-09-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 10 September 2020 at 14:31:41 UTC, Andre Pany wrote: Why does it crash? You messed up the pointers. A string is one star. An array of strings is two stars. A pointer to an array of strings is /three/ stars. --- import std; void main() { size_t* i; // this need not be a

Passing string array to C

2020-09-10 Thread Andre Pany via Digitalmars-d-learn
Hi, I have this coding. Function `sample` will later be called from C and should provide access to a string array. I tried to read the string values after the function call and I can access the first string, but for the second string, there is an access violation. Why does it crash? Kind regar