digitalmars.D.learn - how to read a line from stdin ?
- sai (9/9) Nov 15 2005 Could someone please tell me how to read a line from console using stdin...
- Derek Parnell (17/29) Nov 15 2005 Example:
- Sai (2/31) Nov 29 2005
Could someone please tell me how to read a line from console using stdin ? ------------- import std.stream; stdin.readLine(); // is not working ------------- import std.stdio; stdin.readLine(); // compiler error Thanks in advance Sai
Nov 15 2005
On Wed, 16 Nov 2005 00:48:35 +0000 (UTC), sai wrote:Could someone please tell me how to read a line from console using stdin ? ------------- import std.stream; stdin.readLine(); // is not working ------------- import std.stdio; stdin.readLine(); // compiler error Thanks in advance SaiExample: ======================== import std.cstream; import std.stdio; void main() { char[] x; x = din.readLine(); writefln("Got '%s'", x); } ==================== -- Derek (skype: derek.j.parnell) Melbourne, Australia 16/11/2005 12:02:54 PM
Nov 15 2005
Thank you Derek. In article <1ehr73cehnsrq$.kcumt0e14i5w.dlg 40tude.net>, Derek Parnell says...On Wed, 16 Nov 2005 00:48:35 +0000 (UTC), sai wrote:Could someone please tell me how to read a line from console using stdin ? ------------- import std.stream; stdin.readLine(); // is not working ------------- import std.stdio; stdin.readLine(); // compiler error Thanks in advance SaiExample: ======================== import std.cstream; import std.stdio; void main() { char[] x; x = din.readLine(); writefln("Got '%s'", x); } ==================== -- Derek (skype: derek.j.parnell) Melbourne, Australia 16/11/2005 12:02:54 PM
Nov 29 2005