Even simpler. Just use char myarray[4096] and there's no clean-up required

If you take a look at _stat you can get the file size before you start and if you want you can load the whole file into memory (as long as it's not some obscene size).