int x; bool not_accepted = false; while (!not_accepted) { try { write("x: "); readf("%d\n", x); not_accepted = true; } catch (Exception msg) { writeln("Please give a right coordinate"); }
Hi everyone! I'm trying to do error handling (with the try block)
and when I give a wrong value to the variable (it is an integer
and I give a non-number value), then It doesn't let me re get
input. The code:
- how stdin stream works? Flade via Digitalmars-d-learn
- Re: how stdin stream wor... Steven Schveighoffer via Digitalmars-d-learn
- Re: how stdin stream... Flade via Digitalmars-d-learn
- Re: how stdin st... Ali Çehreli via Digitalmars-d-learn
- Re: how stdi... Flade via Digitalmars-d-learn
- Re: how stdi... Flade via Digitalmars-d-learn