Re: How does buffering actually work?

2019-02-28 Thread Cleverson Casarin Uliana via Digitalmars-d-learn
Thanks Adam, I'll test it later. Cheers Cleverson

Re: How does buffering actually work?

2019-02-28 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 28 February 2019 at 23:07:44 UTC, Cleverson Casarin Uliana wrote: How am I suposed to use the flush function? I've found it in the std.stdio reference, buth calling it in my code gives "undefined identifier", even though std.stdio is imported. try stdout.flush(); flush is a me

Re: How does buffering actually work?

2019-02-28 Thread Cleverson Casarin Uliana via Digitalmars-d-learn
Hi, thank you both Ali and Sarn. How am I suposed to use the flush function? I've found it in the std.stdio reference, buth calling it in my code gives "undefined identifier", even though std.stdio is imported. Greetings, Cleverson

Re: How does buffering actually work?

2019-02-28 Thread sarn via Digitalmars-d-learn
On Thursday, 28 February 2019 at 21:17:23 UTC, Cleverson Casarin Uliana wrote: It works almost perfectly, except that it doesn't wait for my first Enter after printing "First name: value1". Rather, it prints both "First name: value1" and "First name: value2" together on the same line, then it s

Re: How does buffering actually work?

2019-02-28 Thread Ali Çehreli via Digitalmars-d-learn
On 02/28/2019 01:17 PM, Cleverson Casarin Uliana wrote: > I experimented substituting readf for readln, but then it doesn't > recognize my Enter presses and hangs on. > > What is a more suitable aproach to this problem please? readln and strip works, and formattedRead can be useful as well. I ha

How does buffering actually work?

2019-02-28 Thread Cleverson Casarin Uliana via Digitalmars-d-learn
Hi all, this may be a really newbie question but I'm not really used to medium/low level stuff like this. I've actually done the same in Python, and it just works... Supose I want my program to print some content on a given line, lets say "First name: value1", then it should sit down and wait

dmd for Haiku OS

2019-02-28 Thread MGW via Digitalmars-d-learn
I have recently looked through Haiku OS and got surprised to find there dmd 2.072. There was only running file but Phobos and DrinTime were missing. Are there any plans to port dmd to Haiku OS nowadays? Is there a manual (example) on dmd porting on Haiku OS?

Re: dcompute - Error: unrecognized `pragma(LDC_intrinsic)

2019-02-28 Thread Michelle Long via Digitalmars-d-learn
On Thursday, 28 February 2019 at 10:37:22 UTC, Nicholas Wilson wrote: On Thursday, 28 February 2019 at 09:58:35 UTC, Michelle Long wrote: I've included it in Visual D as di and it seems not to add it to the include line... Is it in any way possible that it being an di file would allow that? S

Re: dcompute - Error: unrecognized `pragma(LDC_intrinsic)

2019-02-28 Thread Michelle Long via Digitalmars-d-learn
On Thursday, 28 February 2019 at 11:22:49 UTC, Michelle Long wrote: On Thursday, 28 February 2019 at 10:37:22 UTC, Nicholas Wilson wrote: [...] Yeah, in the config it is [...] Also, is it possible that intrinsics are disabled?

Re: dcompute - Error: unrecognized `pragma(LDC_intrinsic)

2019-02-28 Thread Nicholas Wilson via Digitalmars-d-learn
On Thursday, 28 February 2019 at 09:58:35 UTC, Michelle Long wrote: I've included it in Visual D as di and it seems not to add it to the include line... Is it in any way possible that it being an di file would allow that? Seems that it is an LDC issue though but LDC has some usage of it I bel

Re: dcompute - Error: unrecognized `pragma(LDC_intrinsic)

2019-02-28 Thread Michelle Long via Digitalmars-d-learn
On Thursday, 28 February 2019 at 02:35:59 UTC, Nicholas Wilson wrote: On Wednesday, 27 February 2019 at 22:56:14 UTC, Michelle Long wrote: Trying to get dcompute to work... after a bunch of issues dealing with all the crap this is what I can't get past: Error: unrecognized `pragma(LDC_intrinsi

Re: how to pass a malloc'd C string over to be managed by the GC

2019-02-28 Thread Kagamin via Digitalmars-d-learn
byte[] snappyCompress(in byte[] plaintext) { import deimos.snappy.snappy; size_t output_length = snappy_max_compressed_length(plaintext.length); byte[] output = new byte[output_length]; if(snappy_compress(cast(char*)plaintext.ptr, plaintext.length, cast(char*)output.ptr, &outp