简体   繁体   English

Visual Studio C ++->本地Windows调试器

[英]Visual Studio C++ -> Local Windows Debugger

While running a program in Visual Studio C++ editor, when i click on Local Windows Debugger, the command prompt window opens up, where i am asked to input data (depending on my program). 在Visual Studio C ++编辑器中运行程序时,当我单击“本地Windows调试器”时,将打开命令提示符窗口,要求我在其中输入数据(取决于我的程序)。 The problem is the window doesn't stay very long after the output is shown. 问题是显示输出后窗口不会停留很长时间。

What do i need to do to keep the window up for a longer time, or at least until i close the window myself? 我需要怎么做才能使窗户保持更长的时间,或者至少直到我自己关闭窗户?

I tried for over half hour to check various options and see if there is anything that can be done to prolong the duration. 我尝试了半个多小时,以检查各种选项,看看是否可以采取任何措施来延长持续时间。

Thanks and regards, Nikhil Kenvetil 谢谢和问候,尼基尔·肯维蒂尔

尝试使用以下方法之一在main()函数的末尾添加一些代码:

  1. getchar();
  2. char ch; cin>>ch;

Try this: 尝试这个:

#include <iostream>
#include "conio.h"

int main()
{
    std::cout << "Hello World\n";
    getch();    
    return 0;
}

您可以尝试使用system(“ PAUSE”);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM