rmathis

rmathis

  • NA
  • 10
  • 0

Looping through a binary file?

Oct 14 2003 11:53 AM
Ok, some have probably seen my other e-mails. I don't know if structures are good yet, but I have gotten quite a few messages giving me ideas. Enough so that I want to try to move on to the next step while hoping for more input on my other posts. I need to open a file and loop through it pulling out structures. The only way that I know where one structure begins and another ends, is the size of the struct. In C++, the code looked like this: while (FileRead(hf, &StDbItem, sizeof(DBSTRUCT)) == sizeof(DBSTRUCT) { //code here } Now as people around here know, I'm no C++ wiz, but I understood that code as somehow looping through the database in chunks equal to the size of a DBSTRUCT (look at my other posts to see the struct, but I don't think it matters). Can someone help point me in the right direction? At this point I don't really have a clue, though I was suspecting that I would need to use a binaryreader or something.

Answers (2)