November 22, 2019 Re: How to simulate Window's "Press any key to continue..." | ||||
---|---|---|---|---|
| ||||
Posted in reply to FireController#1847 | On Friday, 22 November 2019 at 04:10:23 UTC, FireController#1847 wrote:
> I'm an extreme beginner to DLang (just started using it.. oh, an hour ago?), and I already can't figure out a, what I'd consider, fairly simplistic thing.
>
> This is my current code:
>
> module DTestApp1;
>
> import std.stdio;
>
> int main() {
> write("Press any key to continue...");
> stdin.read();
> return 0;
> }
>
> I am using Visual Studio to write it, and no matter what I do I cannot get it to work. I attempted to import std.stream;, but it said that while it could find the file, it cannot be read. Am I using the wrong function?
>
> For those who don't know, what I'm trying to do is pause the program until literally any key is pressed while in the console.
execute(["pause"]);
|
Copyright © 1999-2021 by the D Language Foundation