www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

D - sample code for stdin on linux

↑ ↓ ← "Ahmet Takci" <atakci yahoo.com> writes:
Hi ,

   Could someone post a sample code on how to get data from stdin and print
out to stdout in Linux ??

Regards,
Ahmet
Dec 24 2003
↑ ↓ → Ant <duitoolkit yahoo.ca> writes:
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
Dec 24 2003