Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » BUG? or Not BUG? LoadFile(filename) and then getting wrong data
Re: BUG? or Not BUG? LoadFile(filename) and then getting wrong data [message #33445 is a reply to message #33443] Mon, 08 August 2011 09:48 Go to previous messageGo to previous message
silverx is currently offline  silverx
Messages: 62
Registered: March 2011
Member
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.

David
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Polymorphic Array doubt
Next Topic: Need help about the codepage!
Goto Forum:
  


Current Time: Wed May 15 05:09:03 CEST 2024

Total time taken to generate the page: 0.01949 seconds