How to redirect cin and cout to files?

后端 未结 5 1524
慢半拍i
慢半拍i 2020-11-22 07:24

How can I redirect cin to in.txt and cout to out.txt?

5条回答
  •  忘了有多久
    2020-11-22 07:41

    assuming your compiles prog name is x.exe and $ is the system shell or prompt

    $ x outfile 
    

    will take input from infile and will output to outfile .

提交回复
热议问题