Re: Use C struct declaration without knowing definition

2019-07-24 Thread Ben Ogles via Digitalmars-d-learn
On Thursday, 25 July 2019 at 01:08:48 UTC, Ali Çehreli wrote: And that type is traded as pointer to some_type on the C API, right? Usually there is a factory method that returns a pointer to a dynamically allocated object. Correct, there is a function prototype that returns a dynamically

Re: Use C struct declaration without knowing definition

2019-07-24 Thread Ali Çehreli via Digitalmars-d-learn
On 07/24/2019 05:35 PM, Ben Ogles wrote: > Is there a way to use a C header that contains a struct declaration but > no definition? > > For example, the C header may contain: > > typedef struct some_type_s some_type; > > Which is only fully defined in the implementing C file: > > struct

Use C struct declaration without knowing definition

2019-07-24 Thread Ben Ogles via Digitalmars-d-learn
Is there a way to use a C header that contains a struct declaration but no definition? For example, the C header may contain: typedef struct some_type_s some_type; Which is only fully defined in the implementing C file: struct some_type_s { ... }; I am trying to wrap the header in D:

Re: Return the complete number

2019-07-24 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 16:16:15 UTC, Greatsam4sure wrote: On Wednesday, 24 July 2019 at 15:57:06 UTC, a11e99z wrote: On Wednesday, 24 July 2019 at 15:56:13 UTC, a11e99z wrote: On Wednesday, 24 July 2019 at 15:45:08 UTC, Greatsam4sure wrote: int main(){ double mum = 0; Write("enter a

Re: How to contact people on the forum

2019-07-24 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 16:37:33 UTC, Greatsam4sure wrote: On Wednesday, 24 July 2019 at 15:56:43 UTC, drug wrote: 24.07.2019 18:51, Greatsam4sure пишет: Good day everyone. I am thinking,  if there is a  way to contact any person on dlang forums through mail or any other means. How do I

Re: How to contact people on the forum

2019-07-24 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 16:37:33 UTC, Greatsam4sure wrote: On Wednesday, 24 July 2019 at 15:56:43 UTC, drug wrote: 24.07.2019 18:51, Greatsam4sure пишет: Good day everyone. I am thinking,  if there is a  way to contact any person on dlang forums through mail or any other means. How do I

Re: How to contact people on the forum

2019-07-24 Thread Greatsam4sure via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 15:56:43 UTC, drug wrote: 24.07.2019 18:51, Greatsam4sure пишет: Good day everyone. I am thinking,  if there is a  way to contact any person on dlang forums through mail or any other means. How do I get their email from their forum post? I use thunderbird to

Re: dip1000, perhaps annotate with return, and vibe-d

2019-07-24 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 12:54:51 UTC, aliak wrote: Trying to get dip1000 flag in use. I have this error: Error: returning Optional(null, false).this(value) escapes a reference to parameter value, perhaps annotate with return in this function: public auto some(T)(auto ref T value) {

Re: Return the complete number

2019-07-24 Thread a11e99z via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 16:16:15 UTC, Greatsam4sure wrote: On Wednesday, 24 July 2019 at 15:57:06 UTC, a11e99z wrote: On Wednesday, 24 July 2019 at 15:56:13 UTC, a11e99z wrote: On Wednesday, 24 July 2019 at 15:45:08 UTC, Greatsam4sure The result is always to six significant figure. I

Re: Return the complete number

2019-07-24 Thread Greatsam4sure via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 15:57:06 UTC, a11e99z wrote: On Wednesday, 24 July 2019 at 15:56:13 UTC, a11e99z wrote: On Wednesday, 24 July 2019 at 15:45:08 UTC, Greatsam4sure wrote: int main(){ double mum = 0; Write("enter a number: ") readf(" %s\n",); Writeln(num); } How do I return

Re: Return the complete number

2019-07-24 Thread a11e99z via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 15:45:08 UTC, Greatsam4sure wrote: int main(){ double mum = 0; Write("enter a number: ") readf(" %s\n",); Writeln(num); } How do I return the complete number the user enter since I don't since the user can enter numbers of various length with dmd

Re: Return the complete number

2019-07-24 Thread a11e99z via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 15:56:13 UTC, a11e99z wrote: On Wednesday, 24 July 2019 at 15:45:08 UTC, Greatsam4sure wrote: int main(){ double mum = 0; Write("enter a number: ") readf(" %s\n",); Writeln(num); } How do I return the complete number the user enter since I don't since the

Re: Return the complete number

2019-07-24 Thread a11e99z via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 15:45:08 UTC, Greatsam4sure wrote: int main(){ double mum = 0; Write("enter a number: ") readf(" %s\n",); Writeln(num); } How do I return the complete number the user enter since I don't since the user can enter numbers of various length with dmd

Re: How to contact people on the forum

2019-07-24 Thread drug via Digitalmars-d-learn
24.07.2019 18:51, Greatsam4sure пишет: Good day everyone. I am thinking,  if there is a  way to contact any person on dlang forums through mail or any other means. How do I get their email from their forum post? I use thunderbird to read the forum and every post contains email of its author,

Re: Return the complete number

2019-07-24 Thread drug via Digitalmars-d-learn
24.07.2019 18:45, Greatsam4sure пишет: int main(){  double mum = 0;  Write("enter a number: ")  readf(" %s\n",);  Writeln(num); } How do I return the complete number the user enter since I don't since the user can enter numbers of various length with dmd approximating it. I will

How to contact people on the forum

2019-07-24 Thread Greatsam4sure via Digitalmars-d-learn
Good day everyone. I am thinking, if there is a way to contact any person on dlang forums through mail or any other means. How do I get their email from their forum post?

Return the complete number

2019-07-24 Thread Greatsam4sure via Digitalmars-d-learn
int main(){ double mum = 0; Write("enter a number: ") readf(" %s\n",); Writeln(num); } How do I return the complete number the user enter since I don't since the user can enter numbers of various length with dmd approximating it. I will appreciate any help

dip1000, perhaps annotate with return, and vibe-d

2019-07-24 Thread aliak via Digitalmars-d-learn
Trying to get dip1000 flag in use. I have this error: Error: returning Optional(null, false).this(value) escapes a reference to parameter value, perhaps annotate with return in this function: public auto some(T)(auto ref T value) { return Optional!T(value); // <-- error on this line }