code块输入重定向输出 [英] Code Blocks redirecting input output

查看:241
本文介绍了code块输入重定向输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来code块,我似乎无法得到它与&LT命令行参数工作;输入>输出。有谁知道怎么样?

I'm new to code blocks, and I can't seem to get it to work with command line arguments of < input > output. Does anyone know how to?

我目前能够从给定的文件中读取从argv的传递一个文件[1],但是,该程序犯规自动读取输入也不是正确的输出到文件输出

I'm currently able to read a file passed from argv[1] but, the program doesnt automatically read the input from the given file nor does it right the output to the file output.

我知道它是一套程序的参数,我的论点线是:LIST.TXT&LT;输入>输出

I'm aware it is on set program's arguments, my arguments line is: list.txt < input > output

经过一番研究,我看到一个人做这样的:其中; ./input> ./output,恍如运行的程序,为输入和输出,反正,我也试过,都无济于事。我需要使用的文件处理程序来与它进行交互?它不会使培训就业处,简单的getchar()应该从经过输入文件读取。

After some research I saw a guy doing it like this: < ./input > ./output, seems like running a program to give the input and output, anyways, I've also tried that to no avail. Do I need to use file handlers to interact with it? It doesn't make sence, simple getchar() should read from the passing input file.

我是什么在这里失踪?

在此先感谢

推荐答案

我已经找到一种方法如何做到这一点的CB 13.12

I have found a way how to do it in CB 13.12

Tools -> Configure Tools -> Add:

Name: whatever
Executable: C:\Windows\System32\cmd.exe
Parameters: /C ${TARGET_OUTPUT_BASENAME} exampleArg1 <inputFileRedirect.txt
Working Directory: ${TARGET_OUTPUT_DIR}

据basicaly启动Windows控制台并通过的参数的它。
您也可以将键盘快捷键这些工具。
唯一的缺点我能看到的是,这些工具没有具体项目。

It basicaly launches windows console and passes Parameters to it. You can also assign keyboard shortcuts to these tools. The only disadvantage i can see is that the tools are not project specific.

这篇关于code块输入重定向输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆