I see... thanks to everyone for helping me out!
You can clear the input stream:
while(getchar() != '\n') {};
Or just use readln:
int resp = readln.chomp.to!int;
On Saturday, 28 March 2015 at 03:07:31 UTC, jonaspm wrote:
module main;
import std.stdio;
import std.string;
int main(string[] args)
{
int resp;
char[] p, q;
writefln(MENU DE OPCIONES);
writefln(1) Modus Ponens);
writefln(2) Modus Tollens);
writefln(3) Silogismo
On Friday, 27 March 2015 at 04:37:34 UTC, jonaspm wrote:
Please, i need your help, I tried this:
write(Write p: );
readln(p);
p = chomp(p);
writeln(Write q: );
readln(q);
q = chomp(q);
but the result is:
Write p: Write q:
and doesn't pause to read keyboard input... what's wrong?
Thanks in
On Friday, 27 March 2015 at 04:37:34 UTC, jonaspm wrote:
Please, i need your help, I tried this:
write(Write p: );
readln(p);
p = chomp(p);
writeln(Write q: );
readln(q);
q = chomp(q);
but the result is:
Write p: Write q:
and doesn't pause to read keyboard input... what's wrong?
Thanks in
On 3/27/15 4:22 AM, tcak wrote:
On Friday, 27 March 2015 at 05:17:03 UTC, jonaspm wrote:
but readln(p); isn't supposed to read input and store it into p?
Nope. Parameter is terminator character. Read string is returned from
the function. So, it would be like:
string p = readln();
readln
On Friday, 27 March 2015 at 05:17:03 UTC, jonaspm wrote:
but readln(p); isn't supposed to read input and store it into p?
Nope. Parameter is terminator character. Read string is returned
from the function. So, it would be like:
string p = readln();
module main;
import std.stdio;
import std.string;
int main(string[] args)
{
int resp;
char[] p, q;
writefln(MENU DE OPCIONES);
writefln(1) Modus Ponens);
writefln(2) Modus Tollens);
writefln(3) Silogismo Hipotetico);
writefln(4) Salir);
do{
but readln(p); isn't supposed to read input and store it into p?
On Friday, 27 March 2015 at 04:37:34 UTC, jonaspm wrote:
Please, i need your help, I tried this:
write(Write p: );
readln(p);
p = chomp(p);
writeln(Write q: );
readln(q);
q = chomp(q);
but the result is:
Write p: Write q:
and doesn't pause to read keyboard input... what's wrong?
Thanks in
Please, i need your help, I tried this:
write(Write p: );
readln(p);
p = chomp(p);
writeln(Write q: );
readln(q);
q = chomp(q);
but the result is:
Write p: Write q:
and doesn't pause to read keyboard input... what's wrong?
Thanks in advance!
11 matches
Mail list logo