Need som assistense with readf();

Mr. P-teo dthp18 at gmail.com
Sat Jul 7 15:35:56 PDT 2012


So iv just been getting into D programming, im liking it alot so 
far but i have come across one issue that i am unable to find a 
solution for.

Basically whenever i use readf(); to gather console input it wont 
run the program if there is code afterwards.

Here is an example:


import std.stdio;

int main(){
     long number, number2;
     write("Enter an integer: ");
     readf("%d", &number);
     return 0;
}


That works fine, but if i try and imput 2 numbers to seperate 
variables it doesn't work.


import std.stdio;

int main(){
     long number, number2;
     write("Enter an integer: ");
     readf("%d", &number);
     write("another no";
     readf("%d", &number2);
     return 0;
}



can anyone help me.


More information about the Digitalmars-d-learn mailing list