c++ 输出若干个文件

来源:百度知道 编辑:UC知道 时间:2024/06/15 12:28:32
c++ 读取或输出若干个文件,如何建立输入输出流
例如:
fstream outbinfile
outbinfile.open("f:\\1.jpg",ios::binary|ios::out);
我想连续输出1.jpg 2.jpg 3.jpg ........i.jpg
即如何将i嵌入
outbinfile.open("f:\\1.jpg",ios::binary|ios::out);

我的一个用来自动生成网页的c++程序,供你参考。
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main(int argc, char *argv[])
{
int line_count;
string file_name;
string fold_name;

cout<<"fold name:";
cin>>fold_name;
cout<<"file name:";
cin>>file_name;
cout<<"line count:";
cin>>line_count;

ofstream fout(file_name.c_str());
fout<<"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"<<endl;
fout<<"<html>"<<endl;
fout<<"<head>"<<