fork download
  1. import std.stdio;
  2.  
  3. void main()
  4. {
  5. /* Infinite loop, because the logical expression is always
  6.   * true */
  7. while (true) {
  8. write("0:Exit, 1:Turkish, 2:English - Your choice? ");
  9.  
  10. int choice;
  11. readf(" %s", &choice);
  12.  
  13. if (choice == 0) {
  14. writeln("See you later...");
  15. break; // The only exit of this loop
  16.  
  17. } else if (choice == 1) {
  18. writeln("Merhaba!");
  19.  
  20. } else if (choice == 2) {
  21. writeln("Hello!");
  22.  
  23. } else {
  24. writeln("I don't know that... :/");
  25. }
  26. }
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.d(11): Error: undefined identifier readf
prog.d(11): Error: function expected before (), not readf of type int
stdout
Standard output is empty