是否有一种方法可以在调试VSlick时使用输入文件而不是stdin ?

is there a way to use an input file instead of stdin while debugging with VSlick?

本文关键字:输入 文件 stdin VSlick 调试 一种 方法 是否      更新时间:2023-10-16

我正在尝试调试一个接受stdin输入的c++程序(使用getch())。我需要使用VSlick和输入文件来调试它。我需要一些东西,如果我运行我的程序,就像这样:myInputFile

但显然,在Vslick中。

我试过使用'<myInputFile'作为命令行参数,但无济于事。>

10 x

你可以这样做

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

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