I need to read a file in blocks of 200 bytes. So i'm using this:
int readData(char* data, FILE* fp){
sizeReturn=fread(data, 200, 1, fp);
cerr << sizeReturn << endl;
return sizeReturn;
}
while((size=readData(data, fp))>0)
write(fileno(stdout), data, size);
I'm just trying to read the first 200 bytes, i know i need to do a fseek to advance, but i can't even read the first 200 bytes. It returns 0 bytes read. I need to read 200 by 200 on each loop because i'm sending it using udp, so i'm testing with a small number of bytes. Someone can help me to read the first 200 bytes.
Thanks