65,210
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char c;
ifstream fin("program.cpp"); // open the current file where main() resides
if(!fin)
{ // check whether the file is opend successfully
return 1;
}
while(fin.get(c))
{ // read and print to screen till we meet eof
cout << c;
}
fin.close(); // close the ifstream
system("pause");
return 0;
}