simple console input's not working...

SodiumFree bob at pistachios.com
Thu Jun 5 19:19:49 PDT 2008


So i copy this code, pretty much straight from the book (page 139):

module inputTest;
import tango.io.Console;

void main(){
    Cout("What is your name? ").flush;
    auto name = Cin.readln;
    Cout("Hello ")(name).newline;
}


However when i try compiling, dmd spits out this error:

C:\d.stuff\inputTest>dmd inputTest.d
inputTest.d(6): function tango.io.Console.Console.Input.readln (char[],bool) does not match parameter types ()
inputTest.d(6): Error: expected 2 arguments, not 0
inputTest.d(7): function alias tango.io.Console.Console.Output.append (char[]) does not match parameter types (bool)
inputTest.d(7): Error: expected 0 arguments, not 1


Any idea what's going on?


More information about the Digitalmars-d-learn mailing list