On 2/12/18 12:33 AM, Norm wrote:
Hi,
I'm new to D so can someone explain to me what is happening here?
void func(const char* s, char** e) {
import core.stdc.stdlib;
auto result = strtod(s, e);
}
Error: function core.stdc.stdlib.strtod (scope inout(char)* nptr, scope
inout(char)** e
lobo wrote:
sure, i meant that you have to modify the second parameter accordingly. ;-)
anyway, it's good that you fixed it.
On Monday, 12 February 2018 at 05:37:23 UTC, ketmar wrote:
Norm wrote:
Hi,
I'm new to D so can someone explain to me what is happening
here?
void func(const char* s, char** e) {
import core.stdc.stdlib;
auto result = strtod(s, e);
}
Error: function core.stdc.stdlib.strtod (scope
On Monday, 12 February 2018 at 05:33:16 UTC, Norm wrote:
I thought inout was supposed to take const or non-const
variants, so expected the original const char* s to work.
The problem is in argument e: it's mutable, and strtod stores
there a part of s, if s is const you end up with const data
Norm wrote:
Hi,
I'm new to D so can someone explain to me what is happening here?
void func(const char* s, char** e) {
import core.stdc.stdlib;
auto result = strtod(s, e);
}
Error: function core.stdc.stdlib.strtod (scope inout(char)* nptr, scope
inout(char)** endptr) is not callab