<i id='smro3'><tr id='smro3'><dt id='smro3'><q id='smro3'><span id='smro3'><b id='smro3'><form id='smro3'><ins id='smro3'></ins><ul id='smro3'></ul><sub id='smro3'></sub></form><legend id='smro3'></legend><bdo id='smro3'><pre id='smro3'><center id='smro3'></center></pre></bdo></b><th id='smro3'></th></span></q></dt></tr></i><div id='smro3'><tfoot id='smro3'></tfoot><dl id='smro3'><fieldset id='smro3'></fieldset></dl></div>
    • <bdo id='smro3'></bdo><ul id='smro3'></ul>
    <legend id='smro3'><style id='smro3'><dir id='smro3'><q id='smro3'></q></dir></style></legend>
  • <small id='smro3'></small><noframes id='smro3'>

    <tfoot id='smro3'></tfoot>

      1. Windows 上的 C++ - 控制台窗口只是闪烁并消失.这是怎么回事?

        时间:2023-08-27

        <small id='wA0Ig'></small><noframes id='wA0Ig'>

      2. <i id='wA0Ig'><tr id='wA0Ig'><dt id='wA0Ig'><q id='wA0Ig'><span id='wA0Ig'><b id='wA0Ig'><form id='wA0Ig'><ins id='wA0Ig'></ins><ul id='wA0Ig'></ul><sub id='wA0Ig'></sub></form><legend id='wA0Ig'></legend><bdo id='wA0Ig'><pre id='wA0Ig'><center id='wA0Ig'></center></pre></bdo></b><th id='wA0Ig'></th></span></q></dt></tr></i><div id='wA0Ig'><tfoot id='wA0Ig'></tfoot><dl id='wA0Ig'><fieldset id='wA0Ig'></fieldset></dl></div>
          <bdo id='wA0Ig'></bdo><ul id='wA0Ig'></ul>
              <tbody id='wA0Ig'></tbody>

            1. <tfoot id='wA0Ig'></tfoot>

                  <legend id='wA0Ig'><style id='wA0Ig'><dir id='wA0Ig'><q id='wA0Ig'></q></dir></style></legend>
                  本文介绍了Windows 上的 C++ - 控制台窗口只是闪烁并消失.这是怎么回事?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  可能的重复:
                  Visual Studio 控制台应用程序 - 防止窗口关闭. >

                  我开始在 Windows 上学习 C++,并且正在尝试几种不同的开发环境:1. Netbeans 与 Cygwin 编译器2. 微软 Visual Studio 2010

                  I'm starting to learn C++ on Windows and I'm trying a few different development environments: 1. Netbeans with Cygwin compiler 2. MS Visual Studio 2010

                  对于它们中的任何一个,当我编写一个非常简单的 Hello World 程序时,我都会构建它并且它很好.但是当我尝试运行该程序时,命令提示符窗口弹出得非常快,然后立即消失.

                  For either of them, when I write a very simple Hello World program, I build it and it's fine. But when I try to run the program, the command prompt window pops up really quick and then disappears right away.

                  无论是在调试还是发布配置中都会发生这种情况.请帮忙解决这个问题 - 我看不到我的程序输出!:(

                  This happens whether it's in Debug or Release config. Please help with this - I can't see my program output! :(

                  谢谢.

                  编辑 1:感谢您的回复.这是我的代码:

                  Thanks for the replies. This is my code:

                  #include <iostream>
                  
                  int main()
                  {
                      std::cout << "This is a test." << std::endl;
                      return 0;
                  }
                  

                  我尝试了 Ctrl+F5 的不调试启动",但没有用.它仍然闪烁黑色控制台屏幕,然后立即消失.

                  I tried Ctrl+F5 for "Start without Debugging" and that doesn't work. It still flashes the black console screen then disappears right away.

                  我也尝试添加 std::cin.get();这适用于 Ctrl+F5,但这不是一个真正......不雅的解决方案吗?我宁愿让我的程序处于最终形式.

                  I also tried adding in std::cin.get(); and this works with Ctrl+F5, but isn't that a really... inelegant workaround solution? I'd rather have my program in the final form.

                  断点有效,但随后我必须运行调试,控制台窗口闪烁并消失,但随后它留在后台.有什么方法可以让控制台保持在前台,以便我可以立即看到程序输出?看起来它应该是这样工作的.

                  The breakpoint works, but then I have to run with debugging and the console window flashes and disappears, but then it stays in the background. Any way to get the console to stay in the foreground so I can see program output right away? Seems like that's how it should work.

                  还有什么想法吗?为什么 Ctrl+F5 不起作用?

                  Any more ideas? Why wouldn't Ctrl+F5 work?

                  推荐答案

                  完成程序后,按 Ctrl + F5 ( Run without debugging).这将在关闭窗口之前提示,这就是您想要的.

                  After you are done with your program, press Ctrl + F5 ( Run without debugging). This will prompt before closing the window and this is what you want.

                  这篇关于Windows 上的 C++ - 控制台窗口只是闪烁并消失.这是怎么回事?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Netbeans“解决缺少的调试器命令"C++ 下一篇:apache netbeans 11.3 C++ 插件超时,无法安装

                  相关文章

                • <tfoot id='fcBpU'></tfoot>
                  <legend id='fcBpU'><style id='fcBpU'><dir id='fcBpU'><q id='fcBpU'></q></dir></style></legend>
                • <i id='fcBpU'><tr id='fcBpU'><dt id='fcBpU'><q id='fcBpU'><span id='fcBpU'><b id='fcBpU'><form id='fcBpU'><ins id='fcBpU'></ins><ul id='fcBpU'></ul><sub id='fcBpU'></sub></form><legend id='fcBpU'></legend><bdo id='fcBpU'><pre id='fcBpU'><center id='fcBpU'></center></pre></bdo></b><th id='fcBpU'></th></span></q></dt></tr></i><div id='fcBpU'><tfoot id='fcBpU'></tfoot><dl id='fcBpU'><fieldset id='fcBpU'></fieldset></dl></div>
                • <small id='fcBpU'></small><noframes id='fcBpU'>

                      <bdo id='fcBpU'></bdo><ul id='fcBpU'></ul>