Getch() Problem: C vs D

Era Scarecrow via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 9 15:33:45 PST 2017


On Monday, 9 January 2017 at 20:12:38 UTC, Adam D. Ruppe wrote:
> Probably a bug, though I don't like using the getch function, I 
> usually use the full input stream.

  For direct interactions (a game menu or similar) getting 
individual characters makes sense; I can't help but think 
Rogue-likes. However for data input (per line basis) or doing 
bulk data/processing, it doesn't work well.

  Something to comment on, a while back when I was first getting 
into C and MS-DOS assembly programming, I did a direct file-copy 
using only one character input/write at a time. A meg sized file 
probably took a minute or so while if I did something as small as 
a 4k buffer it took moments (approx 8000x faster). This was back 
in 1996 or so, still it's obvious the advantages of working in 
bulk.


More information about the Digitalmars-d-learn mailing list