eclipse CDT写c++使用文件作为输入源(输入重定向)

在main函数第一句添加下面。

freopen("inputfile","r",stdin);

创建一个inputfile,放project根文件夹下。


注意添加:

#include<cstdio>


做ACM题目的时候实用。

【推广】 免费学中医,健康全家人
原文地址:https://www.cnblogs.com/llguanli/p/8926877.html