Any solution will be a variation of that, such as processing the file in smaller chunks individually rather than growing an array, or getting the size of the file with some non-portable method such as fstat.

>will this still work when dealing with binary files
It should, though a little more detail in what kind of data you're working with and what you're doing would help me to give you a more definite answer.

sorry about that.. basically i will be attempting to load a number of different files and there is no pre-defined structure to them.. the over-all code will go to form part of a basic form of encryption, where by the file will e loaded in binary. Block of the data will then be transformed and output into a file.