是否有一种方法可以在调试VSlick时使用输入文件而不是stdin ?
is there a way to use an input file instead of stdin while debugging with VSlick?
我正在尝试调试一个接受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
在项目属性(工具)中,您可以为调试和执行定义命令行。
相关文章:
- 用c++从输入文件中读取另一行
- 更改.cpp程序的输入文件中数据的位置会意外更改输出
- 获取通过重定向传入的输入文件的名称?
- C++ 如何打开带有另一个目录的输入文件?
- C++模板编程设计问题 - 根据输入文件返回不同的类型
- 如何从输入文件 c++ 创建随机名称生成器
- 从输入文件修剪空格
- 链接器输入文件未使用,因为链接未完成,我无法获得.o
- 我正在尝试从输入文件中读取,然后使用它们的子字符串比较字符串的特定部分
- 我遇到使用 c++ 逐行读取输入文件的问题
- 使用重定向命令从 stdin 读入的字符串"<"输入文件未正确附加
- 使用 getline 从输入文件打印时如何忽略空白行
- 如何按升序对输入文件中的数字进行排序,并找到它们的范围和中值
- 数组大小由输入文件中的行数定义
- 从C++输入文件读取
- 在课堂上创建了一个朋友,给出"无输入文件"错误
- 通过显示一行星号来创建条形图,该条形图将读取数据的输入文件
- 利用输入文件中的数据(字符串和int)并在循环中利用
- C++ 仅读取输入文件中的部分(不是全部)数据以添加到记录中
- 如何从输入文件中读取字符并将其存储到向量中?