Computer Chess Club Archives


Search

Terms

Messages

Subject: Off topic: problems with fread in MVC

Author: Carlos del Cacho

Date: 12:49:52 10/05/00



Okay, I know I shouldn't post this kind of stuff... but somebody out there can
help me ? I've ported Pepito to MVC recently and everything is working fine
except reading opening book to memory. MVC's executable just reads 11 book
entries in a file where there's more thatn 120000 ?! Here's the code:


#define           ADD_INC   5  // we're reading it in chunks. GCC can read
entire

                  int count = ADD_INC;
                  entrada_hash *t;
		  printf("Book loaded.\n");
		  fseek(fich,0L,SEEK_SET);
		  for (tab.book_size = 0, t = tab.trans_tab; count == ADD_INC;
                       t+= ADD_INC)
                  {
		    count = fread((void*)t,(size_t)sizeof
                            (entrada_hash),ADD_INC,fich);
		    tab.book_size += count;
		    printf("Reading chunk %d\n",count);
                    if (ferror(fich))
	              perror("Error: ");
		  }



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.