【问题标题】:is there a way to use an input file instead of stdin while debugging with VSlick?有没有办法在使用 VSlick 进行调试时使用输入文件而不是标准输入?
【发布时间】:2011-08-11 11:27:17
【问题描述】:

我正在尝试调试一个接受来自标准输入的输入的 C++ 程序(使用 getch())。我需要使用 VSlick 和输入文件对其进行调试。我需要一些可以运行的东西,就像我运行我的程序一样:myProgram

但显然,在 Vslick 中。

我尝试使用 '

10 倍

【问题讨论】:

    标签: c++ input arguments stdin


    【解决方案1】:

    这是你可以做的事情

    freopen("input.txt","r",stdin);  //For input from input.txt
    freopen("output.txt","w",stdout); //for output to output.txt
    

    【讨论】:

      【解决方案2】:

      在项目属性(工具)中,您可以为调试和执行定义命令行。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-03-29
        相关资源
        最近更新 更多