Here is some C++ code that can do this:
#define max_file_size 102400
char buffer[max_file_size];
long file_size, len1, len2;
int num_blocks;
int file_in, file_out;
file_in = _open(input_file, _O_BINARY | _O_RDONLY);
file_size = filelength(file_in);
num_blocks = (int)(file_size / 102400);
char number[100] = "\0";
for (int j=0; j<num_blocks; j++)
{
_itoa(i, number, 10);
strcat(output_file, number);
file_out = _open(output_file, _O_BINARY | _O_WRONLY | _O_CREAT);
for (int i = 0; i< 35; i++)
{
len1 = _read(file_in, buffer, max_file_size);
len2 = _write(file_out, buffer, max_file_size);
}
_close(file_out);
}
_close(file_in);
Keep in mind function does no error handling. Its something I put together for breaking long mp3 files. let me know if you have questions.
BTW. you will need to include io.h in the driver program. It generates 35 mb files from a larger file named output_file1, output_file2 etc...