Ok, I have attached a file. It has the smallsample2.dat which is the input file. It is in byte 12 and a couple of bytes after that it shows in the promptok as being a negative number. As you can see I defined thebyte as int unsigned, which means it shouldn't have any sign to it.
Then I have 2 programs. The first that is bad which is ReadFullFill, and it gives bad results.
Then I have a program ReadFileByte, which uses the reading it one byte at a time from the input file. Which when I try and process the large file it takes for ever, and gives me program not responding. Another issue I need to find out what to do about it.
Anyway the ReadFileByte, it gives the correct result.
I am using the int value in my program as an index into an array to get me data. And when it comes back as a negative number it was causing data exceptions error as the index put it outside of the array.
I am using the same define in both programs. And as I said I tried to use char in the bad program and got the same result.