ifstream怎么用啊,ofstream一学就会,可是ifstream没有输出和创建文件啊
rt,求解
2013-09-15 21:27
2013-09-15 21:58
2013-09-15 22:29
2013-09-16 07:31
2013-09-16 23:39
2013-09-16 23:52
程序代码:
char data;
std::ifstream infile("D:\\456.txt");
while (infile.peek() != EOF) {
infile.get(data);
std::cout.put(data);
}
std::cout<<endl;
infile.close();
2013-09-17 05:47
程序代码:#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream infile("C:\\456.txt");
for( char data; infile.get(data); )
{
cout.put( data );
}
cout << endl;
infile.close();
return 0;
}
2013-09-17 10:56
2013-09-17 22:14

不错
2013-09-27 14:02