码迷,mamicode.com
首页 > 编程语言 > 详细

C++ 文件操作

时间:2015-06-21 14:23:23      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:

#include <fstream>
#include <iostream>

int main(int,char**){
    ifstream input("input.txt");
    char c;
    while (!input.eof()){
        input >> c;
        cout << c << endl;
    }
    input.close();
    while (1){}
    return 0;
}

而读取中文字符,只需要将char c 改成 char c[2]。

简单粗暴。

C++ 文件操作

标签:

原文地址:http://www.cnblogs.com/LBsolution/p/4591883.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!