[英]Command Prompt Input and Output
I want to take data from 'input.txt' to run 'main.exe' and then save the result of that program with this data to 'output.txt'.我想从“input.txt”中获取数据来运行“main.exe”,然后将该程序的结果与这些数据一起保存到“output.txt”中。 If possible, I would like to write wwith form <input.txt> <output.txt>.
如果可能的话,我想用表单 <input.txt> <output.txt> 来写。
First you need to compile your c++ program, then run it with the two parameters.首先您需要编译您的 c++ 程序,然后使用这两个参数运行它。 See cplusplus.com for some tutorials on file in and file out and the resource for taking in command line arguments: https://www.geeksforgeeks.org/command-line-arguments-in-c-cpp/
有关文件输入和文件输出的一些教程以及用于获取命令行arguments的资源,请参阅 cplusplus.com: httpscommand-/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.