Re: Reading a single whitespace-separated word from stdin

2014-05-06 Thread Mark Isaacson via Digitalmars-d-learn
An exceptionally generous offer! May take you up on that. Thank you :).

Re: Reading a single whitespace-separated word from stdin

2014-05-06 Thread bearophile via Digitalmars-d-learn
Mark Isaacson: Indeed. However, doing so looks more painful than redefining my goals. Upon further examination it seems that I had more flexibility than I originally estimated. Besides, the real reason I'm implementing this project is just to practice for when I get to write production D code

Re: Reading a single whitespace-separated word from stdin

2014-05-06 Thread Mark Isaacson via Digitalmars-d-learn
Indeed. However, doing so looks more painful than redefining my goals. Upon further examination it seems that I had more flexibility than I originally estimated. Besides, the real reason I'm implementing this project is just to practice for when I get to write production D code in a week anyway

Re: Reading a single whitespace-separated word from stdin

2014-05-06 Thread bearophile via Digitalmars-d-learn
Mark Isaacson: Fair enough. I've done stuff like that in the past. I'm trying to implement a university project that was originally designed for C++ style I/O... and so where I'd have otherwise jumped at something like that from the beginning, my hands are slightly tied. If you need/want to

Re: Reading a single whitespace-separated word from stdin

2014-05-06 Thread Mark Isaacson via Digitalmars-d-learn
Fair enough. I've done stuff like that in the past. I'm trying to implement a university project that was originally designed for C++ style I/O... and so where I'd have otherwise jumped at something like that from the beginning, my hands are slightly tied. Suppose I'll make due/not fully comp

Re: Reading a single whitespace-separated word from stdin

2014-05-06 Thread bearophile via Digitalmars-d-learn
Mark Isaacson: I'm trying my hand at reading from standard input and having little luck. In particular, I would like to be able to do the rough equivalent of C++'s: cin >> myString; There isn't always a 1:1 mapping between C++ and D. In D if you want a single word you usually read the whol

Reading a single whitespace-separated word from stdin

2014-05-05 Thread Mark Isaacson via Digitalmars-d-learn
I'm trying my hand at reading from standard input and having little luck. In particular, I would like to be able to do the rough equivalent of C++'s: cin >> myString; As opposed to reading the whole line. I attempted to do this with readf: string result; readf(" %s ", &result); However th