//file_uniter.cpp //Unites N files into a single file (or separates them back). //FB - 201011301 #include #include #include #include using namespace std; class str { public: string s; unsigned int l; }; int main(int argc, char *argv[]) { if(argc > 2) { cerr<<"Too many arguments!"<=0;--k) { infile.get(c); uc=c; l+=uc*(j<<(8*k)); } cout<<"size:"< f_names; //file names str st; while(true) { getline(cin,st.s); if(st.s.empty()) break; ifstream infile(st.s.c_str(),ios::in|ios::binary); if(!infile) { cerr<<"The file "<>s; ofstream outfile(s.c_str(), ios::out|ios::binary); if(!outfile) { cerr<<"The file "<(f_names.at(i).l>>24)); outfile.put(static_cast((f_names.at(i).l>>16)%256)); outfile.put(static_cast((f_names.at(i).l>>8)%256)); outfile.put(static_cast(f_names.at(i).l%256)); //write the file ifstream infile(f_names.at(i).s.c_str(),ios::in|ios::binary); for(unsigned int j=0;j