Check out Dev-C++. It's fairly simple to set up and use. Here's a fairly crude program I whipped up that should do what you want (there are already many available to accomplish this function, but you may benefit from seeing the source code) - just copy and paste it into Dev-C++ if you like:
Code:
#include <iostream>
#include <fstream>
#include <sstream>
#include <math.h>
using namespace std;
const unsigned int BUFFER_SIZE = 1024;
int main(int argc, char *argv[]) {
char name[256];
unsigned int chunkSize;
start:
cout << "Enter path to file to be split: ";
cin >> name;
cout << "Enter size of each chunk in bytes: ";
cin >> chunkSize;
if(chunkSize == 0) {
cout << "Zero is bad. :( Aborting..." << endl;
goto start;
}
ifstream fileIn(name, ios::in | ios::binary);
if(!fileIn) {
cout << "Error opening file. Aborting..." << endl;
goto start;
}
fileIn.seekg(0, ios::end);
streampos fileLength = fileIn.tellg();
fileIn.seekg(0, ios::beg);
char copyBuffer[BUFFER_SIZE];
for(unsigned int chunkNumber = 0; ; ++chunkNumber) {
if(fileLength <= 0) break;
cout << "Writing chunk number " << chunkNumber << "..." << endl;
ostringstream chunkNameStream;
chunkNameStream << name << chunkNumber;
string chunkName = chunkNameStream.str();
ofstream chunkOut(chunkName.c_str(), ios::out | ios::binary | ios::trunc);
if(!chunkOut) {
cout << "Error creating \"" << chunkName << "\". Aborting..." << endl;
goto start;
}
unsigned int chunkCopied = 0;
while(fileLength > 0 && chunkCopied < chunkSize) {
unsigned int toBeCopied = min((unsigned long long) min(BUFFER_SIZE, chunkSize - chunkCopied), (unsigned long long) fileLength);
unsigned int copied = fileIn.readsome(copyBuffer, toBeCopied);
chunkOut.write(copyBuffer, copied);
fileLength -= copied;
chunkCopied += copied;
}
chunkOut.close();
}
fileIn.close();
cout << "Operation complete." << endl;
goto start;
return 0;
}
EDIT: Just as a side note, it will only work for file chunk sizes up to 4GB when compiled for 32-bit systems. (This could easily be fixed with little modification, but I'm off to bed right now.
)