I've been looking for a solution to split a file with any file format, using C++. what i've found so far and tried as well, could only split .txt file. To split (say .docx) file into 2 files is possible, but to open splitted files give error. The same is true with other file formats. For example try the the code below with a different file extension rather than .txt or .dat (say .jpg).
is anyone who have a solution?
using namespace std;
ifstream fin1, fin2;
char ch, file_name1, file_name2, file_name3;
cout<<"\n Enter First File Name with Extension !=.txt : ";
cout<<"\n Enter Second File Name with Extension !=.txt : ";
cout<<"\n Enter Third File Name with Extension !=.txt ";
cout<<"\n (which will Store the Contents of \n First File and Second File) : ";
if(fin1==NULL || fin2==NULL)
cout<<"\n Invalid File Name. \n There is no such File ...";
cout<<"\n Invalid File Name. \n There is no such File...";
I didn't find the right solution from the internet.
- Field Management Video Examples