简体   繁体   中英

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'. If possible, I would like to write wwith form <input.txt> <output.txt>.在此处输入图像描述

First you need to compile your c++ program, then run it with the two parameters. 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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM