I want to read from few parts of a file and than output it as one unsigned char. This is a simplified version of this:
void loadPartsOfFile (const char *filename, unsigned char **output)
{
*output = malloc(333);
FILE *file = fopen(filename, "rb");
fseek(file, 0, SEEK_SET);
fread(*output, 1, 111, file);
fseek(file, 10254, SEEK_SET);
fread(*output, 1, 222, file);
fclose(file);
}
Second fread just overwrites what first added to output. Is there a way to append second data stream to output?