December 24, 2003 sample code for stdin on linux | ||||
---|---|---|---|---|
| ||||
Hi , Could someone post a sample code on how to get data from stdin and print out to stdout in Linux ?? Regards, Ahmet |
December 24, 2003 Re: sample code for stdin on linux | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ahmet Takci | On Wed, 24 Dec 2003 14:43:46 +0200, Ahmet Takci wrote:
> Hi ,
>
> Could someone post a sample code on how to get data from stdin and print
> out to stdout in Linux ??
>
> Regards,
> Ahmet
like this?:
###########################
import std.stream;
void main()
{
char[] line;
while( line != "exit")
{
printf("type 'exit' to exit\nenter line:\n");
line = stdin.readLine();
stdout.write("got line:\n" ~ line ~ "\n\n");
}
}
###########################
check phobos/std/stream.d for more
Ant
|
Copyright © 1999-2021 by the D Language Foundation