Also, when loading the array, make certain that the array is of the correct size to hold the file (or larger). From the code you've posted, I don't see any obvious problems, but you might try a couple of tests. For one thing, enlarge the array you're loading into. Using path strings in file names, such as "C:\WINDOWS..." etc., may cause problems if they don't match perfectly. It's usually a good idea to leave that kind of information out, especially when testing the program. The files, therefore will be written by default to the same directory as the programs run in. Another reason to avoid paths is that if you want to give your program to someone else, they may not have the same directory structure on their computer as you do.
In any case, keep looking -- it's in there somewhere!