reverse a file character to another file

#include <stdio.h>
#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
using namespace std;

int main() 

    ifstream fin("main.cpp");
    ofstream fout("a.cpp");
    string str;
    string filestr;
    char a[100];
    while(getline(fin,str))
    {
        filestr += (str + '\n');
    }
    int i = filestr.size();
    for(int i = filestr.size()-1; i>= 0; i--)
    {
        fout<<filestr[i];
    }

    system("pause");
    return 0;
}

posted on 2012-08-22 09:04 三少_爷 阅读(100) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2012年8月>
2930311234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

常用链接

留言簿

随笔分类

随笔档案

My Website

搜索

最新评论

阅读排行榜

评论排行榜