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
On 07/07/2012 03:35 PM, Mr. P-teo wrote:
> Basically whenever i use readf(); to gather console input it wont run
> the program if there is code afterwards.
readf() does not automatically consume the end-of-line character.
> That works fine, but if i try and imput 2 numbers to seperate variables
Just insert spaces before the format specifiers:
import std.stdio;
int main(){
long number, number2;
write("Enter an integer: ");
readf(" %d", &number);
write("another no");
readf(" %d", &number2);
writeln(number, ' ', number2);
return 0;
}
Ali
Thanks very muc