all blacks 0 Newbie Poster

I wan to read from multiple files and write into 1 file....the fuse_cortex_header_r function will read a file and then break the file into several file which only consist of classes...for fuse_cortex_header_w file, i would like to read all the files which have been writen by previous function and write everthing back into 1 basically works as a splitter and combiner...But the write function doesnt seems working very well, i only could read 1 file and write it in 1 file, there is still 39 classes to be read and written after the 1st is the code

#include "stdafx.h"
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

void Fuse_cortex_header_r(){

    char str[99999];
    string str2, str3, str4;
    size_t pos, pos1;
    fstream file_op("c:\\Fuse_cortex.h",ios::in);
    string s = str;

	for(int ctr = 1; ctr < 41; ctr++)
        stringstream sstrm, sstrm2, sstrm3;
        sstrm << "c:\\Fuse_cortex#" << ctr << ".txt";
        sstrm2 << "//cls#" << ctr;
        sstrm3 << "//cls*" << ctr;
        string filename = sstrm.str();
        string start = sstrm2.str();
        string end = sstrm3.str();
        pos = s.find(start);    
        str2 = s.substr (pos);
        str4 = str2.substr(0,pos1+8);
        fstream file_op2(filename.c_str(), ios::out);

void Fuse_cortex_header_w(){
	stringstream sstrm;
                char str[9999];

	for(int ctr = 1; ctr < 41; ctr++){

	sstrm << "c:\\Fuse_cortex#" << ctr << ".txt";
	string filename = sstrm.str();

	fstream file_op3(filename.c_str(), ios::in);

	string s_class = str;

	fstream file_op4("c:\\Fuse_cortex_header.txt", ios::app);
	file_op4 << s_class;

int main ()
    cout << "Successfully Splitted "<< endl; 
    cout << "Successfully Combined " << endl;
    return 0;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.