如何使用 Eclipse 运行命令更改 stdin Stream?

发布于 2024-09-25 15:15:35 字数 230 浏览 0 评论 0原文

我正在开发一个项目,在该项目中,我不应该使用命令行参数,而应该将文件通过管道传输到标准输入,并将输出通过管道传输到另一个文件。

即我需要运行类似的命令:

./program < infile.txt > outfile.txt

有没有办法向 Eclipse 指定这是运行时我想要的命令?

我正在运行 Eclipse-C/C++ 环境。

I'm working on a project where rather than using command line arguments I am supposed to just pipe a file to stdin and pipe output to another file.

ie I need to run something like:

./program < infile.txt > outfile.txt

Is there a way to specify to Eclipse this is the command I want when it is run?

I am running the Eclipse-C/C++ environment.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

近箐 2024-10-02 15:15:35

使用 Eclipse 一段时间后,似乎没有一种简单的方法可以做到这一点。我只是添加调试代码来指定文件,然后将其声明为输入流。

After using Eclipse for some time, it seems like there is not a straightforward way of doing this. I've resorted to just adding debug code to specify a file and then declare it as an input stream.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文