Read/Write large arrays from/to a file (efficient plz)
as final result I want to read/write per random access in binary files to retrieve a block/part of a really large array.
So how could one write such an array as fast as possible to disk?
I know about using fwrite(myArray, sizeof(int), arraySize, myFile); but there is such a thing as setvbuf.
So how could one determine the best buffer size and what does it look like in detail as setvbuf call? I found different use of setvbuf for example NULL as buffer.
Any help, ideas would be most appreciated.